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