blob: e9bef4cdb76261f50e2f9668e098f7e393031588 [file] [log] [blame]
Fariborz Jahanian451b92a2014-07-16 16:16:04 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
2// rdar://16462586
3
4__attribute__((objc_runtime_name("MySecretNamespace.Protocol")))
5@protocol Protocol
6@end
7
8__attribute__((objc_runtime_name("MySecretNamespace.Message")))
9@interface Message <Protocol> {
10__attribute__((objc_runtime_name("MySecretNamespace.Message"))) // expected-error {{'objc_runtime_name' attribute only applies to interface or protocol declarations}}
11 id MyIVAR;
12}
13__attribute__((objc_runtime_name("MySecretNamespace.Message")))
14@property int MyProperty; // expected-error {{prefix attribute must be followed by an interface or protocol}}}}
15
16- (int) getMyProperty __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to interface or protocol declarations}}
17
18- (void) setMyProperty : (int) arg __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to interface or protocol declarations}}
19
20@end
21
22__attribute__((objc_runtime_name("MySecretNamespace.ForwardClass")))
23@class ForwardClass; // expected-error {{prefix attribute must be followed by an interface or protocol}}
24
25__attribute__((objc_runtime_name("MySecretNamespace.ForwardProtocol")))
26@protocol ForwardProtocol;
27
28__attribute__((objc_runtime_name("MySecretNamespace.Message")))
29@implementation Message // expected-error {{prefix attribute must be followed by an interface or protocol}}
30__attribute__((objc_runtime_name("MySecretNamespace.Message")))
31- (id) MyMethod {
32 return MyIVAR;
33}
34@end