1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
2 | |
3 | @interface INTF1 @end |
4 | |
5 | @protocol p1,p2,p3; // expected-note {{protocol 'p2' has no definition}} \ |
6 | // expected-note {{protocol 'p3' has no definition}} |
7 | |
8 | @protocol p1; |
9 | |
10 | @protocol PROTO1 |
11 | - (INTF1<p1>*) meth; |
12 | @end |
13 | |
14 | @protocol p1 @end |
15 | |
16 | @interface I1 <p1> @end |
17 | |
18 | @interface E1 <p2> @end // expected-warning {{cannot find protocol definition for 'p2'}} |
19 | |
20 | @protocol p2 @end |
21 | |
22 | |
23 | @interface I2 <p1,p2> @end |
24 | |
25 | @interface E2 <p1,p2,p3> @end // expected-warning {{cannot find protocol definition for 'p3'}} |
26 | |
27 | @class U1, U2; // expected-note {{forward declaration of class here}} |
28 | |
29 | @interface E3 : U1 @end // expected-error {{attempting to use the forward class 'U1' as superclass of 'E3'}} |
30 | |
31 | |
32 | @interface I3 : E3 @end |
33 | |
34 | @interface U2 @end |
35 | |
36 | @interface I4 : U2 <p1,p2> |
37 | @end |
38 | |
39 | // rdar://16111182 |
40 | @interface NSObject @end |
41 | |
42 | @protocol UndefinedParentProtocol; // expected-note {{protocol 'UndefinedParentProtocol' has no definition}} |
43 | |
44 | @protocol UndefinedProtocol <UndefinedParentProtocol> |
45 | @end |
46 | |
47 | @interface SomeObject : NSObject <UndefinedProtocol> // expected-warning {{cannot find protocol definition for 'UndefinedProtocol'}} |
48 | @end |
49 | |