Fariborz Jahanian | bc1c877 | 2008-12-17 01:07:27 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | __attribute ((unavailable)) |
| 4 | @protocol FwProto; |
| 5 | |
| 6 | Class <FwProto> cFw = 0; // expected-warning {{'FwProto' is unavailable}} |
| 7 | |
| 8 | |
| 9 | __attribute ((deprecated)) @protocol MyProto1 |
| 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 |
| 37 | |
| 38 | @interface MyClass2 <FwProto> // expected-warning {{'FwProto' is unavailable}} |
| 39 | @end |
| 40 | |
| 41 | __attribute ((unavailable)) __attribute ((deprecated)) @protocol XProto; |
| 42 | |
| 43 | id <XProto> idX = 0; // expected-warning {{'XProto' is unavailable}} expected-warning {{'XProto' is deprecated}} |
| 44 | |
| 45 | int main () |
| 46 | { |
| 47 | MyClass1 <MyProto1> *p1; // expected-warning {{'MyProto1' is deprecated}} |
| 48 | } |
| 49 | |