1 // 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 35