1// RUN: %clang_cc1 -fsyntax-only -verify %s 2// rdar://9092208 3 4__attribute__((unavailable("not available"))) 5@interface MyClass { // expected-note 8 {{declaration has been explicitly marked unavailable here}} 6@public 7 void *_test; 8 MyClass *ivar; // no error. 9} 10 11- (id)self; 12- new; 13+ (void)addObject:(id)anObject; 14- (MyClass *)meth; // no error. 15 16@end 17 18@interface Foo { 19 MyClass *ivar; // expected-error {{unavailable}} 20} 21- (MyClass *)meth; // expected-error {{unavailable}} 22@end 23 24@interface MyClass (Cat1) 25- (MyClass *)meth; // no error. 26@end 27 28@interface MyClass (Cat2) // no error. 29@end 30 31@implementation MyClass (Cat2) // expected-error {{unavailable}} 32@end 33 34int main() { 35 [MyClass new]; // expected-error {{'MyClass' is unavailable: not available}} 36 [MyClass self]; // expected-error {{'MyClass' is unavailable: not available}} 37 [MyClass addObject:((void *)0)]; // expected-error {{'MyClass' is unavailable: not available}} 38 39 MyClass *foo = [MyClass new]; // expected-error 2 {{'MyClass' is unavailable: not available}} 40 41 return 0; 42} 43