xref: /aosp_15_r20/external/clang/test/SemaObjC/no-protocol-option-tests.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -fsyntax-only -Wno-protocol -verify -Wno-objc-root-class %s
2*67e74705SXin Li// rdar: // 7056600
3*67e74705SXin Li
4*67e74705SXin Li@protocol P
5*67e74705SXin Li- PMeth;
6*67e74705SXin Li@end
7*67e74705SXin Li
8*67e74705SXin Li// Test1
9*67e74705SXin Li@interface I  <P> @end
10*67e74705SXin Li@implementation I @end //  no warning with -Wno-protocol
11*67e74705SXin Li
12*67e74705SXin Li// Test2
13*67e74705SXin Li@interface C -PMeth; @end
14*67e74705SXin Li@interface C (Category) <P> @end
15*67e74705SXin Li@implementation C (Category) @end //  no warning with -Wno-protocol
16*67e74705SXin Li
17*67e74705SXin Li// Test2
18*67e74705SXin Li@interface super - PMeth; @end
19*67e74705SXin Li@interface J : super <P>
20*67e74705SXin Li- PMeth;	// expected-note {{method 'PMeth' declared here}}
21*67e74705SXin Li@end
22*67e74705SXin Li@implementation J @end // expected-warning {{method definition for 'PMeth' not found}}
23*67e74705SXin Li
24*67e74705SXin Li// Test3
25*67e74705SXin Li@interface K : super <P>
26*67e74705SXin Li@end
27*67e74705SXin Li@implementation K @end // no warning with -Wno-protocol
28*67e74705SXin Li
29*67e74705SXin Li// Test4
30*67e74705SXin Li@interface Root @end
31*67e74705SXin Li@interface L : Root<P> @end
32*67e74705SXin Li@implementation L @end // no warning with -Wno-protocol
33