Patrick Beard | b2f6820 | 2012-04-06 18:12:22 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -Wdeprecated-implementations -verify -Wno-objc-root-class %s |
Fariborz Jahanian | b1224f6 | 2011-02-15 00:59:30 +0000 | [diff] [blame] | 2 | // rdar://8973810 |
Fariborz Jahanian | 5fa6676 | 2012-11-17 20:53:53 +0000 | [diff] [blame] | 3 | // rdar://12717705 |
Fariborz Jahanian | b1224f6 | 2011-02-15 00:59:30 +0000 | [diff] [blame] | 4 | |
| 5 | @protocol P |
Ted Kremenek | 3306ec1 | 2012-02-27 22:55:11 +0000 | [diff] [blame] | 6 | - (void) D __attribute__((deprecated)); // expected-note {{method 'D' declared here}} |
Fariborz Jahanian | b1224f6 | 2011-02-15 00:59:30 +0000 | [diff] [blame] | 7 | @end |
| 8 | |
| 9 | @interface A <P> |
Fariborz Jahanian | 5fa6676 | 2012-11-17 20:53:53 +0000 | [diff] [blame] | 10 | + (void)F __attribute__((deprecated)); |
Fariborz Jahanian | b1224f6 | 2011-02-15 00:59:30 +0000 | [diff] [blame] | 11 | @end |
| 12 | |
| 13 | @interface A() |
Ted Kremenek | 3306ec1 | 2012-02-27 22:55:11 +0000 | [diff] [blame] | 14 | - (void) E __attribute__((deprecated)); // expected-note {{method 'E' declared here}} |
Fariborz Jahanian | b1224f6 | 2011-02-15 00:59:30 +0000 | [diff] [blame] | 15 | @end |
| 16 | |
| 17 | @implementation A |
Fariborz Jahanian | 5fa6676 | 2012-11-17 20:53:53 +0000 | [diff] [blame] | 18 | + (void)F { } // No warning, implementing its own deprecated method |
Fariborz Jahanian | b1224f6 | 2011-02-15 00:59:30 +0000 | [diff] [blame] | 19 | - (void) D {} // expected-warning {{Implementing deprecated method}} |
| 20 | - (void) E {} // expected-warning {{Implementing deprecated method}} |
| 21 | @end |
| 22 | |
Fariborz Jahanian | 5fa6676 | 2012-11-17 20:53:53 +0000 | [diff] [blame] | 23 | @interface A(CAT) |
| 24 | - (void) G __attribute__((deprecated)); |
| 25 | @end |
| 26 | |
| 27 | @implementation A(CAT) |
| 28 | - (void) G {} // No warning, implementing its own deprecated method |
| 29 | @end |
| 30 | |
Fariborz Jahanian | b1224f6 | 2011-02-15 00:59:30 +0000 | [diff] [blame] | 31 | __attribute__((deprecated)) |
Fariborz Jahanian | 350e956 | 2012-05-27 16:59:48 +0000 | [diff] [blame] | 32 | @interface CL // expected-note 2 {{class declared here}} // expected-note 2 {{declared here}} |
Fariborz Jahanian | b1224f6 | 2011-02-15 00:59:30 +0000 | [diff] [blame] | 33 | @end |
| 34 | |
| 35 | @implementation CL // expected-warning {{Implementing deprecated class}} |
| 36 | @end |
| 37 | |
Argyrios Kyrtzidis | c076e37 | 2011-10-06 23:23:27 +0000 | [diff] [blame] | 38 | @implementation CL ( SomeCategory ) // expected-warning {{'CL' is deprecated}} \ |
| 39 | // expected-warning {{Implementing deprecated category}} |
Fariborz Jahanian | b1224f6 | 2011-02-15 00:59:30 +0000 | [diff] [blame] | 40 | @end |
| 41 | |
| 42 | @interface CL_SUB : CL // expected-warning {{'CL' is deprecated}} |
| 43 | @end |
| 44 | |
| 45 | @interface BASE |
Ted Kremenek | 3306ec1 | 2012-02-27 22:55:11 +0000 | [diff] [blame] | 46 | - (void) B __attribute__((deprecated)); // expected-note {{method 'B' declared here}} |
Fariborz Jahanian | b1224f6 | 2011-02-15 00:59:30 +0000 | [diff] [blame] | 47 | @end |
| 48 | |
| 49 | @interface SUB : BASE |
| 50 | @end |
| 51 | |
| 52 | @implementation SUB |
| 53 | - (void) B {} // expected-warning {{Implementing deprecated method}} |
| 54 | @end |
| 55 | |