blob: d92e3d35cfbfc536d6cc61e5929a5d9dfc8a2ec9 [file] [log] [blame]
Nico Weber9f4f5f12013-04-03 17:36:11 +00001// 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
Nico Webere145bfd2013-04-04 00:15:10 +000014@interface EXP I @end // expected-error {{postfix attributes are not allowed on Objective-C directives, place them in front of '@interface'}}
Nico Weber9f4f5f12013-04-03 17:36:11 +000015EXP @interface I2 @end
16
Nico Webere145bfd2013-04-04 00:15:10 +000017@implementation EXP I @end // expected-error-re {{postfix attributes are not allowed on Objective-C directives$}}
Nico Weber9f4f5f12013-04-03 17:36:11 +000018// FIXME: Prefix attribute recovery skips until ';'
Nico Webere145bfd2013-04-04 00:15:10 +000019EXP @implementation I2 @end; // expected-error {{prefix attribute must be followed by an interface or protocol}}
Nico Weber9f4f5f12013-04-03 17:36:11 +000020
Nico Webere145bfd2013-04-04 00:15:10 +000021@class EXP OC; // expected-error-re {{postfix attributes are not allowed on Objective-C directives$}}
Nico Weber9f4f5f12013-04-03 17:36:11 +000022EXP @class OC2; // expected-error {{prefix attribute must be followed by an interface or protocol}}
23
Nico Webere145bfd2013-04-04 00:15:10 +000024@protocol EXP P @end // expected-error {{postfix attributes are not allowed on Objective-C directives, place them in front of '@protocol'}}
Nico Weber9f4f5f12013-04-03 17:36:11 +000025EXP @protocol P2 @end