Fariborz Jahanian | bc1c877 | 2008-12-17 01:07:27 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | __attribute ((unavailable)) |
Douglas Gregor | 48f3bb9 | 2009-02-18 21:56:37 +0000 | [diff] [blame] | 4 | @protocol FwProto; // expected-note{{marked unavailable}} |
Fariborz Jahanian | bc1c877 | 2008-12-17 01:07:27 +0000 | [diff] [blame] | 5 | |
Steve Naroff | 4262a07 | 2009-02-23 18:53:24 +0000 | [diff] [blame] | 6 | Class <FwProto> cFw = 0; // expected-warning {{'FwProto' is unavailable}} expected-error{{protocol qualified 'Class' is unsupported}} |
Fariborz Jahanian | bc1c877 | 2008-12-17 01:07:27 +0000 | [diff] [blame] | 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 | |
Steve Naroff | 4262a07 | 2009-02-23 18:53:24 +0000 | [diff] [blame] | 34 | Class <MyProto1> clsP1 = 0; // expected-warning {{'MyProto1' is deprecated}} expected-error{{protocol qualified 'Class' is unsupported}} |
Fariborz Jahanian | bc1c877 | 2008-12-17 01:07:27 +0000 | [diff] [blame] | 35 | |
Douglas Gregor | 48f3bb9 | 2009-02-18 21:56:37 +0000 | [diff] [blame] | 36 | @protocol FwProto @end // expected-note{{marked unavailable}} |
Fariborz Jahanian | bc1c877 | 2008-12-17 01:07:27 +0000 | [diff] [blame] | 37 | |
| 38 | @interface MyClass2 <FwProto> // expected-warning {{'FwProto' is unavailable}} |
| 39 | @end |
| 40 | |
Douglas Gregor | 48f3bb9 | 2009-02-18 21:56:37 +0000 | [diff] [blame] | 41 | __attribute ((unavailable)) __attribute ((deprecated)) @protocol XProto; // expected-note{{marked unavailable}} |
Fariborz Jahanian | bc1c877 | 2008-12-17 01:07:27 +0000 | [diff] [blame] | 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 | |