99 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3__attribute__((objc_root_class))4@interface RootClass5 6- (void)baseMethod;7 8@end9 10__attribute__((objc_direct_members))11@interface I : RootClass12 13- (void)direct; // expected-note {{direct member declared here}}14 15@end16 17@protocol P18- (void)direct;19@end20 21@interface I (Cat1) <P> // expected-error {{category 'Cat1' cannot conform to protocol 'P' because of direct members declared in interface 'I'}}22@end23 24@protocol BaseP25- (void)baseMethod;26@end27 28@interface I (CatBase) <BaseP> // OK29@end30 31@protocol P232- (void)indirect;33@end34 35@interface I (Cat2) <P2> // OK36- (void)indirect;37@end38 39@protocol P340- (void)indirect3;41@end42 43@interface I (Cat3) <P3> // OK44@end45 46@interface ExpDirect : RootClass47 48- (void)direct __attribute__((objc_direct)); // expected-note {{direct member declared here}}49 50- (void)directRecursive __attribute__((objc_direct)); // expected-note {{direct member declared here}}51 52@end53 54@interface ExpDirect (CatExpDirect) <P> // expected-error {{category 'CatExpDirect' cannot conform to protocol 'P' because of direct members declared in interface 'ExpDirect'}}55@end56 57@protocol PRecursive158- (void)directRecursive;59@end60 61@protocol PRecursiveTop <PRecursive1>62@end63 64@interface ExpDirect () <PRecursiveTop> // expected-error {{class extension cannot conform to protocol 'PRecursive1' because of direct members declared in interface 'ExpDirect'}}65@end66 67 68@protocol PProp69 70@property (nonatomic, readonly) I *name;71 72@end73 74__attribute__((objc_direct_members))75@interface IProp1 : RootClass76 77@property (nonatomic, readonly) I *name; // expected-note {{direct member declared here}}78 79@end80 81@interface IProp1 () <PProp> // expected-error {{class extension cannot conform to protocol 'PProp' because of direct members declared in interface 'IProp1'}}82@end83 84 85@protocol PProp286 87@property (nonatomic, readonly, class) I *name;88 89@end90 91@interface IProp2 : RootClass92 93@property (nonatomic, readonly, class, direct) I *name; // expected-note {{direct member declared here}}94 95@end96 97@interface IProp2 () <PProp2> // expected-error {{class extension cannot conform to protocol 'PProp2' because of direct members declared in interface 'IProp2'}}98@end99