1 | // RUN: %clang_cc1 -verify -fsyntax-only -Wno-objc-root-class %s |
2 | |
3 | __attribute__((deprecated)) @class B; // expected-error {{prefix attribute must be followed by an interface or protocol}} |
4 | |
5 | __attribute__((deprecated)) @interface A @end |
6 | __attribute__((deprecated)) @protocol P0; |
7 | __attribute__((deprecated)) @protocol P1 |
8 | @end |
9 | |
10 | #define EXP __attribute__((visibility("default"))) |
11 | class EXP C {}; |
12 | EXP class C2 {}; // expected-warning {{attribute 'visibility' is ignored, place it after "class" to apply attribute to type declaration}} |
13 | |
14 | @interface EXP I @end // expected-error {{postfix attributes are not allowed on Objective-C directives, place them in front of '@interface'}} |
15 | EXP @interface I2 @end |
16 | |
17 | @implementation EXP I @end // expected-error-re {{postfix attributes are not allowed on Objective-C directives{{$}}}} |
18 | // FIXME: Prefix attribute recovery skips until ';' |
19 | EXP @implementation I2 @end; // expected-error {{prefix attribute must be followed by an interface or protocol}} |
20 | |
21 | @class EXP OC; // expected-error-re {{postfix attributes are not allowed on Objective-C directives{{$}}}} |
22 | EXP @class OC2; // expected-error {{prefix attribute must be followed by an interface or protocol}} |
23 | |
24 | @protocol EXP P @end // expected-error {{postfix attributes are not allowed on Objective-C directives, place them in front of '@protocol'}} |
25 | EXP @protocol P2 @end |
26 | |