annotate clang/test/Parser/attributes.mm @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -verify -fsyntax-only -Wno-objc-root-class %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 // FIXME: Why isn't this supported? Seems useful for availability attributes at
anatofuz
parents:
diff changeset
4 // the very least.
anatofuz
parents:
diff changeset
5 __attribute__((deprecated)) @class B; // expected-error {{prefix attribute must be followed by an interface, protocol, or implementation}}
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 __attribute__((deprecated)) @interface A @end
anatofuz
parents:
diff changeset
8 __attribute__((deprecated)) @protocol P0;
anatofuz
parents:
diff changeset
9 __attribute__((deprecated)) @protocol P1
anatofuz
parents:
diff changeset
10 @end
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 #define EXP __attribute__((visibility("default")))
anatofuz
parents:
diff changeset
13 class EXP C {};
anatofuz
parents:
diff changeset
14 EXP class C2 {}; // expected-warning {{attribute 'visibility' is ignored, place it after "class" to apply attribute to type declaration}}
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 @interface EXP I @end // expected-error {{postfix attributes are not allowed on Objective-C directives, place them in front of '@interface'}}
anatofuz
parents:
diff changeset
17 EXP @interface I2 @end
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 @implementation EXP I @end // expected-error-re {{postfix attributes are not allowed on Objective-C directives{{$}}}}
anatofuz
parents:
diff changeset
20 EXP @implementation I2 @end
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 @class EXP OC; // expected-error-re {{postfix attributes are not allowed on Objective-C directives{{$}}}}
anatofuz
parents:
diff changeset
23 EXP @class OC2; // expected-error {{prefix attribute must be followed by an interface, protocol, or implementation}}
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 @protocol EXP P @end // expected-error {{postfix attributes are not allowed on Objective-C directives, place them in front of '@protocol'}}
anatofuz
parents:
diff changeset
26 EXP @protocol P2 @end