1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify %s 2*f4a2713aSLionel Sambuc 3*f4a2713aSLionel Sambuc__attribute ((unavailable)) 4*f4a2713aSLionel Sambuc@protocol FwProto; // expected-note{{marked unavailable}} 5*f4a2713aSLionel Sambuc 6*f4a2713aSLionel SambucClass <FwProto> cFw = 0; // expected-error {{'FwProto' is unavailable}} 7*f4a2713aSLionel Sambuc 8*f4a2713aSLionel Sambuc 9*f4a2713aSLionel Sambuc__attribute ((deprecated)) @protocol MyProto1 // expected-note 7 {{declared here}} 10*f4a2713aSLionel Sambuc@end 11*f4a2713aSLionel Sambuc 12*f4a2713aSLionel Sambuc@protocol Proto2 <MyProto1> // expected-warning {{'MyProto1' is deprecated}} 13*f4a2713aSLionel Sambuc+method2; 14*f4a2713aSLionel Sambuc@end 15*f4a2713aSLionel Sambuc 16*f4a2713aSLionel Sambuc 17*f4a2713aSLionel Sambuc@interface MyClass1 <MyProto1> // expected-warning {{'MyProto1' is deprecated}} 18*f4a2713aSLionel Sambuc{ 19*f4a2713aSLionel Sambuc Class isa; 20*f4a2713aSLionel Sambuc} 21*f4a2713aSLionel Sambuc@end 22*f4a2713aSLionel Sambuc 23*f4a2713aSLionel Sambuc@interface Derived : MyClass1 <MyProto1> // expected-warning {{'MyProto1' is deprecated}} 24*f4a2713aSLionel Sambuc{ 25*f4a2713aSLionel Sambuc id <MyProto1> ivar; // expected-warning {{'MyProto1' is deprecated}} 26*f4a2713aSLionel Sambuc} 27*f4a2713aSLionel Sambuc@end 28*f4a2713aSLionel Sambuc 29*f4a2713aSLionel Sambuc@interface MyClass1 (Category) <MyProto1, Proto2> // expected-warning {{'MyProto1' is deprecated}} 30*f4a2713aSLionel Sambuc@end 31*f4a2713aSLionel Sambuc 32*f4a2713aSLionel Sambuc 33*f4a2713aSLionel Sambuc 34*f4a2713aSLionel SambucClass <MyProto1> clsP1 = 0; // expected-warning {{'MyProto1' is deprecated}} 35*f4a2713aSLionel Sambuc 36*f4a2713aSLionel Sambuc@protocol FwProto @end // expected-note{{marked unavailable}} 37*f4a2713aSLionel Sambuc 38*f4a2713aSLionel Sambuc@interface MyClass2 <FwProto> // expected-error {{'FwProto' is unavailable}} 39*f4a2713aSLionel Sambuc@end 40*f4a2713aSLionel Sambuc 41*f4a2713aSLionel Sambuc__attribute ((unavailable)) __attribute ((deprecated)) @protocol XProto; // expected-note{{marked unavailable}} 42*f4a2713aSLionel Sambuc 43*f4a2713aSLionel Sambucid <XProto> idX = 0; // expected-error {{'XProto' is unavailable}} 44*f4a2713aSLionel Sambuc 45*f4a2713aSLionel Sambucint main () 46*f4a2713aSLionel Sambuc{ 47*f4a2713aSLionel Sambuc MyClass1 <MyProto1> *p1; // expected-warning {{'MyProto1' is deprecated}} 48*f4a2713aSLionel Sambuc} 49*f4a2713aSLionel Sambuc 50