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