1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-protocol-method-implementation %s
3 __attribute__((objc_root_class))
8 - (void)A_Cat __attribute__((objc_direct)); // expected-note {{previous declaration is here}}
12 - (void)A_Cat { // expected-error {{direct method was declared in a category but is implemented in the primary interface}}
16 __attribute__((objc_root_class))
18 - (void)B_primary __attribute__((objc_direct)); // expected-note {{previous declaration is here}}
22 - (void)B_extension __attribute__((objc_direct)); // expected-note {{previous declaration is here}}
26 - (void)B_Cat __attribute__((objc_direct));
29 @interface B (OtherCat)
30 - (void)B_OtherCat __attribute__((objc_direct)); // expected-note {{previous declaration is here}}
38 - (void)B_implOnly __attribute__((objc_direct)) { // expected-note {{previous declaration is here}}
42 @implementation B (Cat)
43 - (void)B_primary { // expected-error {{direct method was declared in the primary interface but is implemented in a category}}
45 - (void)B_extension { // expected-error {{direct method was declared in an extension but is implemented in a different category}}
49 - (void)B_OtherCat { // expected-error {{direct method was declared in a category but is implemented in a different category}}
51 - (void)B_implOnly __attribute__((objc_direct)) { // expected-error {{direct method declaration conflicts with previous direct declaration of method 'B_implOnly'}}
55 __attribute__((objc_root_class))
57 - (void)C1 __attribute__((objc_direct)); // expected-note {{previous declaration is here}}
58 - (void)C2; // expected-note {{previous declaration is here}}
62 - (void)C1; // expected-error {{method declaration conflicts with previous direct declaration of method 'C1'}}
63 - (void)C2 __attribute__((objc_direct)); // expected-error {{direct method declaration conflicts with previous declaration of method 'C2'}}