1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 __attribute__((objc_root_class))
10 __attribute__((objc_direct_members))
11 @interface I : RootClass
13 - (void)direct; // expected-note {{direct member declared here}}
21 @interface I (Cat1) <P> // expected-error {{category 'Cat1' cannot conform to protocol 'P' because of direct members declared in interface 'I'}}
28 @interface I (CatBase) <BaseP> // OK
35 @interface I (Cat2) <P2> // OK
43 @interface I (Cat3) <P3> // OK
46 @interface ExpDirect : RootClass
48 - (void)direct __attribute__((objc_direct)); // expected-note {{direct member declared here}}
50 - (void)directRecursive __attribute__((objc_direct)); // expected-note {{direct member declared here}}
54 @interface ExpDirect (CatExpDirect) <P> // expected-error {{category 'CatExpDirect' cannot conform to protocol 'P' because of direct members declared in interface 'ExpDirect'}}
58 - (void)directRecursive;
61 @protocol PRecursiveTop <PRecursive1>
64 @interface ExpDirect () <PRecursiveTop> // expected-error {{class extension cannot conform to protocol 'PRecursive1' because of direct members declared in interface 'ExpDirect'}}
70 @property (nonatomic, readonly) I *name;
74 __attribute__((objc_direct_members))
75 @interface IProp1 : RootClass
77 @property (nonatomic, readonly) I *name; // expected-note {{direct member declared here}}
81 @interface IProp1 () <PProp> // expected-error {{class extension cannot conform to protocol 'PProp' because of direct members declared in interface 'IProp1'}}
87 @property (nonatomic, readonly, class) I *name;
91 @interface IProp2 : RootClass
93 @property (nonatomic, readonly, class, direct) I *name; // expected-note {{direct member declared here}}
97 @interface IProp2 () <PProp2> // expected-error {{class extension cannot conform to protocol 'PProp2' because of direct members declared in interface 'IProp2'}}