1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
2 | // rdar://8769853 |
3 | |
4 | @interface B |
5 | - (void) depInA; |
6 | - (void) unavailMeth __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} |
7 | - (void) depInA1 __attribute__((deprecated)); // expected-note {{'depInA1' has been explicitly marked deprecated here}} |
8 | - (void) unavailMeth1; |
9 | - (void) depInA2 __attribute__((deprecated)); // expected-note {{'depInA2' has been explicitly marked deprecated here}} |
10 | - (void) unavailMeth2 __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} |
11 | - (void) depunavailInA; |
12 | - (void) depunavailInA1 __attribute__((deprecated)) __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} |
13 | - (void)FuzzyMeth __attribute__((deprecated)); // expected-note {{'FuzzyMeth' has been explicitly marked deprecated here}} |
14 | - (void)FuzzyMeth1 __attribute__((unavailable)); |
15 | @end |
16 | |
17 | @interface A |
18 | - (void) unavailMeth1 __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} |
19 | - (void) depInA __attribute__((deprecated)); // expected-note {{'depInA' has been explicitly marked deprecated here}} |
20 | - (void) depInA2 __attribute__((deprecated)); |
21 | - (void) depInA1; |
22 | - (void) unavailMeth2 __attribute__((unavailable)); |
23 | - (void) depunavailInA __attribute__((deprecated)) __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} |
24 | - (void) depunavailInA1; |
25 | - (void)FuzzyMeth __attribute__((unavailable)); |
26 | - (void)FuzzyMeth1 __attribute__((deprecated)); // expected-note {{'FuzzyMeth1' has been explicitly marked deprecated here}} |
27 | @end |
28 | |
29 | |
30 | @class C; // expected-note 10 {{forward declaration of class here}} |
31 | |
32 | void test(C *c) { |
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}} |
43 | |
44 | } |
45 | |
46 | // rdar://10268422 |
47 | __attribute ((deprecated)) // expected-note {{'DEPRECATED' has been explicitly marked deprecated here}} |
48 | @interface DEPRECATED |
49 | +(id)new; |
50 | @end |
51 | |
52 | void foo() { |
53 | [DEPRECATED new]; // expected-warning {{'DEPRECATED' is deprecated}} |
54 | } |
55 | |
56 | |