Fariborz Jahanian | 8e5fc9b | 2010-12-21 00:44:01 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | // rdar://8769853 |
| 3 | |
| 4 | @interface B |
| 5 | - (void) depInA; |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 6 | - (void) unavailMeth __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 7 | - (void) depInA1 __attribute__((deprecated)); // expected-note {{'depInA1' has been explicitly marked deprecated here}} |
Fariborz Jahanian | 8e5fc9b | 2010-12-21 00:44:01 +0000 | [diff] [blame] | 8 | - (void) unavailMeth1; |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 9 | - (void) depInA2 __attribute__((deprecated)); // expected-note {{'depInA2' has been explicitly marked deprecated here}} |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 10 | - (void) unavailMeth2 __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} |
Fariborz Jahanian | 8e5fc9b | 2010-12-21 00:44:01 +0000 | [diff] [blame] | 11 | - (void) depunavailInA; |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 12 | - (void) depunavailInA1 __attribute__((deprecated)) __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 13 | - (void)FuzzyMeth __attribute__((deprecated)); // expected-note {{'FuzzyMeth' has been explicitly marked deprecated here}} |
Fariborz Jahanian | 8e5fc9b | 2010-12-21 00:44:01 +0000 | [diff] [blame] | 14 | - (void)FuzzyMeth1 __attribute__((unavailable)); |
| 15 | @end |
| 16 | |
| 17 | @interface A |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 18 | - (void) unavailMeth1 __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 19 | - (void) depInA __attribute__((deprecated)); // expected-note {{'depInA' has been explicitly marked deprecated here}} |
Fariborz Jahanian | 8e5fc9b | 2010-12-21 00:44:01 +0000 | [diff] [blame] | 20 | - (void) depInA2 __attribute__((deprecated)); |
| 21 | - (void) depInA1; |
| 22 | - (void) unavailMeth2 __attribute__((unavailable)); |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 23 | - (void) depunavailInA __attribute__((deprecated)) __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} |
Fariborz Jahanian | 8e5fc9b | 2010-12-21 00:44:01 +0000 | [diff] [blame] | 24 | - (void) depunavailInA1; |
| 25 | - (void)FuzzyMeth __attribute__((unavailable)); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 26 | - (void)FuzzyMeth1 __attribute__((deprecated)); // expected-note {{'FuzzyMeth1' has been explicitly marked deprecated here}} |
Fariborz Jahanian | 8e5fc9b | 2010-12-21 00:44:01 +0000 | [diff] [blame] | 27 | @end |
| 28 | |
| 29 | |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 30 | @class C; // expected-note 10 {{forward declaration of class here}} |
Fariborz Jahanian | 8e5fc9b | 2010-12-21 00:44:01 +0000 | [diff] [blame] | 31 | |
| 32 | void test(C *c) { |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 33 | [c depInA]; // expected-warning {{'depInA' may be deprecated because the receiver type is unknown}} |
| 34 | [c unavailMeth]; // expected-warning {{'unavailMeth' may be unavailable because the receiver type is unknown}} |
| 35 | [c depInA1]; // expected-warning {{'depInA1' may be deprecated because the receiver type is unknown}} |
| 36 | [c unavailMeth1]; // expected-warning {{'unavailMeth1' may be unavailable because the receiver type is unknown}} |
| 37 | [c depInA2]; // expected-warning {{'depInA2' may be deprecated because the receiver type is unknown}} |
| 38 | [c unavailMeth2]; // expected-warning {{'unavailMeth2' may be unavailable because the receiver type is unknown}} |
| 39 | [c depunavailInA]; // expected-warning {{'depunavailInA' may be unavailable because the receiver type is unknown}} |
| 40 | [c depunavailInA1];// expected-warning {{'depunavailInA1' may be unavailable because the receiver type is unknown}} |
| 41 | [c FuzzyMeth]; // expected-warning {{'FuzzyMeth' may be deprecated because the receiver type is unknown}} |
| 42 | [c FuzzyMeth1]; // expected-warning {{'FuzzyMeth1' may be deprecated because the receiver type is unknown}} |
Fariborz Jahanian | 8e5fc9b | 2010-12-21 00:44:01 +0000 | [diff] [blame] | 43 | |
| 44 | } |
| 45 | |
Fariborz Jahanian | 43bcdb2 | 2011-10-15 19:18:36 +0000 | [diff] [blame] | 46 | // rdar://10268422 |
| 47 | __attribute ((deprecated)) |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 48 | @interface DEPRECATED // expected-note {{'DEPRECATED' has been explicitly marked deprecated here}} |
Fariborz Jahanian | 43bcdb2 | 2011-10-15 19:18:36 +0000 | [diff] [blame] | 49 | +(id)new; |
| 50 | @end |
| 51 | |
| 52 | void foo() { |
Richard Trieu | 2fe9b7f | 2011-12-15 00:38:15 +0000 | [diff] [blame] | 53 | [DEPRECATED new]; // expected-warning {{'DEPRECATED' is deprecated}} |
Fariborz Jahanian | 43bcdb2 | 2011-10-15 19:18:36 +0000 | [diff] [blame] | 54 | } |
| 55 | |