brintos

brintos / llvm-project-archived public Read only

0
0
Text · 820 B · 1490329 Raw
37 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -verify -Wno-objc-root-class %s2// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class -DNOARC %s3#ifdef NOARC4// expected-no-diagnostics5#endif6 7@interface RetainableArray {8  id flexible[];9#ifndef NOARC10  // expected-error@-2 {{ARC forbids flexible array members with retainable object type}}11#endif12}13@end14@implementation RetainableArray15@end16 17// Emit diagnostic only if have @implementation.18@interface RetainableArrayWithoutImpl {19  id flexible[];20}21@end22 23// With ARC flexible array member objects can be only __unsafe_unretained24@interface UnsafeUnretainedArray {25  __unsafe_unretained id flexible[];26}27@end28@implementation UnsafeUnretainedArray29@end30 31@interface NotObjCLifetimeTypeArray {32  char flexible[];33}34@end35@implementation NotObjCLifetimeTypeArray36@end37