xref: /aosp_15_r20/external/clang/test/SemaObjC/class-conforming-protocol-1.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -Wduplicate-method-match -fsyntax-only -verify %s
2*67e74705SXin Li
3*67e74705SXin Li@protocol P1 @end
4*67e74705SXin Li@protocol P2 @end
5*67e74705SXin Li@protocol P3 @end
6*67e74705SXin Li
7*67e74705SXin Li@interface INTF
8*67e74705SXin Li- (INTF*) METH1;	// expected-note {{previous declaration is here}}
9*67e74705SXin Li- (INTF<P1>*) METH1;	// expected-error {{duplicate declaration of method 'METH1'}}
10*67e74705SXin Li
11*67e74705SXin Li- (INTF<P2,P1>*) METH2;  // expected-note {{previous declaration is here}}
12*67e74705SXin Li- (INTF<P2,P1,P3>*) METH2;  // expected-error {{duplicate declaration of method 'METH2'}}
13*67e74705SXin Li
14*67e74705SXin Li- (INTF<P2,P1,P3>*) METH3; // expected-note {{previous declaration is here}}
15*67e74705SXin Li- (INTF<P3,P1,P2, P3>*) METH3; // expected-warning {{multiple declarations of method 'METH3' found and ignored}}
16*67e74705SXin Li
17*67e74705SXin Li@end
18*67e74705SXin Li
19*67e74705SXin LiINTF<P2,P1,P3>* p1;
20*67e74705SXin Li
21