• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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")))
11class EXP C {};
12EXP 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'}}
15EXP @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 ';'
19EXP @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{{$}}}}
22EXP @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'}}
25EXP @protocol P2 @end
26