annotate clang/test/SemaObjC/protocols.m @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
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 -Wno-deprecated-declarations -verify %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 @interface INTF1
anatofuz
parents:
diff changeset
4 @required // expected-error {{directive may only be specified in protocols only}}
anatofuz
parents:
diff changeset
5 - (int) FooBar;
anatofuz
parents:
diff changeset
6 - (int) FooBar1;
anatofuz
parents:
diff changeset
7 - (int) FooBar2;
anatofuz
parents:
diff changeset
8 @optional // expected-error {{directive may only be specified in protocols only}}
anatofuz
parents:
diff changeset
9 + (int) C;
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 - (int)I;
anatofuz
parents:
diff changeset
12 @end
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 @protocol p1,p2,p3;
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 @protocol p1;
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 @protocol PROTO1
anatofuz
parents:
diff changeset
19 @required
anatofuz
parents:
diff changeset
20 - (int) FooBar;
anatofuz
parents:
diff changeset
21 @optional
anatofuz
parents:
diff changeset
22 - (void) MyMethod1;
anatofuz
parents:
diff changeset
23 + (int) S;
anatofuz
parents:
diff changeset
24 @end
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 @protocol PROTO2<p1>
anatofuz
parents:
diff changeset
28 @end
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 @protocol p1 @end
anatofuz
parents:
diff changeset
31
anatofuz
parents:
diff changeset
32 @protocol PROTO<p1> // expected-note {{previous definition is here}}
anatofuz
parents:
diff changeset
33 @end
anatofuz
parents:
diff changeset
34
anatofuz
parents:
diff changeset
35 @protocol PROTO<p1> // expected-warning {{duplicate protocol definition of 'PROTO'}}
anatofuz
parents:
diff changeset
36 @end
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 @protocol PROTO3<p1, p1>
anatofuz
parents:
diff changeset
39 @end
anatofuz
parents:
diff changeset
40
anatofuz
parents:
diff changeset
41 @protocol p2 <p1>
anatofuz
parents:
diff changeset
42 @end
anatofuz
parents:
diff changeset
43
anatofuz
parents:
diff changeset
44 @protocol PROTO4 <p1, p2, PROTO, PROTO3, p3>
anatofuz
parents:
diff changeset
45 @end
anatofuz
parents:
diff changeset
46
anatofuz
parents:
diff changeset
47
anatofuz
parents:
diff changeset
48 // rdar://6771034
anatofuz
parents:
diff changeset
49 @protocol XX;
anatofuz
parents:
diff changeset
50 @protocol YY <XX> // Use of declaration of XX here should not cause a warning.
anatofuz
parents:
diff changeset
51 - zz;
anatofuz
parents:
diff changeset
52 @end
anatofuz
parents:
diff changeset
53
anatofuz
parents:
diff changeset
54
anatofuz
parents:
diff changeset
55 // Detect circular dependencies.
anatofuz
parents:
diff changeset
56 @protocol B;
anatofuz
parents:
diff changeset
57 @protocol C < B > // expected-note{{previous definition is here}}
anatofuz
parents:
diff changeset
58 @end
anatofuz
parents:
diff changeset
59 @protocol A < C >
anatofuz
parents:
diff changeset
60 @end
anatofuz
parents:
diff changeset
61 @protocol B < A > // expected-error{{protocol has circular dependency}}
anatofuz
parents:
diff changeset
62 @end
anatofuz
parents:
diff changeset
63
anatofuz
parents:
diff changeset
64 @protocol P
anatofuz
parents:
diff changeset
65 - (int)test:(int)param, ..; // expected-warning{{type specifier missing}} \
anatofuz
parents:
diff changeset
66 // expected-error{{expected ';' after method prototype}}
anatofuz
parents:
diff changeset
67 @end