annotate clang/test/SemaObjC/special-dep-unavail-warning.m @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
anatofuz
parents:
diff changeset
2 // rdar://8769853
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 @interface B
anatofuz
parents:
diff changeset
5 - (void) depInA;
anatofuz
parents:
diff changeset
6 - (void) unavailMeth __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
anatofuz
parents:
diff changeset
7 - (void) depInA1 __attribute__((deprecated)); // expected-note {{'depInA1' has been explicitly marked deprecated here}}
anatofuz
parents:
diff changeset
8 - (void) unavailMeth1;
anatofuz
parents:
diff changeset
9 - (void) depInA2 __attribute__((deprecated)); // expected-note {{'depInA2' has been explicitly marked deprecated here}}
anatofuz
parents:
diff changeset
10 - (void) unavailMeth2 __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
anatofuz
parents:
diff changeset
11 - (void) depunavailInA;
anatofuz
parents:
diff changeset
12 - (void) depunavailInA1 __attribute__((deprecated)) __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
anatofuz
parents:
diff changeset
13 - (void)FuzzyMeth __attribute__((deprecated)); // expected-note {{'FuzzyMeth' has been explicitly marked deprecated here}}
anatofuz
parents:
diff changeset
14 - (void)FuzzyMeth1 __attribute__((unavailable));
anatofuz
parents:
diff changeset
15 @end
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 @interface A
anatofuz
parents:
diff changeset
18 - (void) unavailMeth1 __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
anatofuz
parents:
diff changeset
19 - (void) depInA __attribute__((deprecated)); // expected-note {{'depInA' has been explicitly marked deprecated here}}
anatofuz
parents:
diff changeset
20 - (void) depInA2 __attribute__((deprecated));
anatofuz
parents:
diff changeset
21 - (void) depInA1;
anatofuz
parents:
diff changeset
22 - (void) unavailMeth2 __attribute__((unavailable));
anatofuz
parents:
diff changeset
23 - (void) depunavailInA __attribute__((deprecated)) __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
anatofuz
parents:
diff changeset
24 - (void) depunavailInA1;
anatofuz
parents:
diff changeset
25 - (void)FuzzyMeth __attribute__((unavailable));
anatofuz
parents:
diff changeset
26 - (void)FuzzyMeth1 __attribute__((deprecated)); // expected-note {{'FuzzyMeth1' has been explicitly marked deprecated here}}
anatofuz
parents:
diff changeset
27 @end
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 @class C; // expected-note 10 {{forward declaration of class here}}
anatofuz
parents:
diff changeset
31
anatofuz
parents:
diff changeset
32 void test(C *c) {
anatofuz
parents:
diff changeset
33 [c depInA]; // expected-warning {{'depInA' may be deprecated because the receiver type is unknown}}
anatofuz
parents:
diff changeset
34 [c unavailMeth]; // expected-warning {{'unavailMeth' may be unavailable because the receiver type is unknown}}
anatofuz
parents:
diff changeset
35 [c depInA1]; // expected-warning {{'depInA1' may be deprecated because the receiver type is unknown}}
anatofuz
parents:
diff changeset
36 [c unavailMeth1]; // expected-warning {{'unavailMeth1' may be unavailable because the receiver type is unknown}}
anatofuz
parents:
diff changeset
37 [c depInA2]; // expected-warning {{'depInA2' may be deprecated because the receiver type is unknown}}
anatofuz
parents:
diff changeset
38 [c unavailMeth2]; // expected-warning {{'unavailMeth2' may be unavailable because the receiver type is unknown}}
anatofuz
parents:
diff changeset
39 [c depunavailInA]; // expected-warning {{'depunavailInA' may be unavailable because the receiver type is unknown}}
anatofuz
parents:
diff changeset
40 [c depunavailInA1];// expected-warning {{'depunavailInA1' may be unavailable because the receiver type is unknown}}
anatofuz
parents:
diff changeset
41 [c FuzzyMeth]; // expected-warning {{'FuzzyMeth' may be deprecated because the receiver type is unknown}}
anatofuz
parents:
diff changeset
42 [c FuzzyMeth1]; // expected-warning {{'FuzzyMeth1' may be deprecated because the receiver type is unknown}}
anatofuz
parents:
diff changeset
43
anatofuz
parents:
diff changeset
44 }
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 // rdar://10268422
anatofuz
parents:
diff changeset
47 __attribute ((deprecated)) // expected-note {{'DEPRECATED' has been explicitly marked deprecated here}}
anatofuz
parents:
diff changeset
48 @interface DEPRECATED
anatofuz
parents:
diff changeset
49 +(id)new;
anatofuz
parents:
diff changeset
50 @end
anatofuz
parents:
diff changeset
51
anatofuz
parents:
diff changeset
52 void foo() {
anatofuz
parents:
diff changeset
53 [DEPRECATED new]; // expected-warning {{'DEPRECATED' is deprecated}}
anatofuz
parents:
diff changeset
54 }
anatofuz
parents:
diff changeset
55