xref: /aosp_15_r20/external/clang/test/SemaObjC/qualified-protocol-method-conflicts.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1  -Woverriding-method-mismatch -fsyntax-only -verify -Wno-objc-root-class %s
2*67e74705SXin Li// rdar://6191214
3*67e74705SXin Li
4*67e74705SXin Li@protocol Xint
5*67e74705SXin Li-(void) setX: (int) arg0; // expected-note {{previous declaration is here}}
6*67e74705SXin Li+(int) C; // expected-note {{previous declaration is here}}
7*67e74705SXin Li@end
8*67e74705SXin Li
9*67e74705SXin Li@protocol Xfloat
10*67e74705SXin Li-(void) setX: (float) arg0; // expected-note 2 {{previous declaration is here}}
11*67e74705SXin Li+(float) C;		    // expected-note 2 {{previous declaration is here}}
12*67e74705SXin Li@end
13*67e74705SXin Li
14*67e74705SXin Li@interface A <Xint, Xfloat>
15*67e74705SXin Li@end
16*67e74705SXin Li
17*67e74705SXin Li@implementation A
18*67e74705SXin Li-(void) setX: (int) arg0 { } // expected-warning {{conflicting parameter types in declaration of 'setX:': 'float' vs 'int'}}
19*67e74705SXin Li+(int) C {return 0; } // expected-warning {{conflicting return type in declaration of 'C': 'float' vs 'int'}}
20*67e74705SXin Li@end
21*67e74705SXin Li
22*67e74705SXin Li@interface B <Xfloat, Xint>
23*67e74705SXin Li@end
24*67e74705SXin Li
25*67e74705SXin Li@implementation B
26*67e74705SXin Li-(void) setX: (float) arg0 { } // expected-warning {{conflicting parameter types in declaration of 'setX:': 'int' vs 'float'}}
27*67e74705SXin Li+ (float) C {return 0.0; } // expected-warning {{conflicting return type in declaration of 'C': 'int' vs 'float'}}
28*67e74705SXin Li@end
29*67e74705SXin Li
30*67e74705SXin Li@protocol Xint_float<Xint, Xfloat>
31*67e74705SXin Li@end
32*67e74705SXin Li
33*67e74705SXin Li@interface C<Xint_float>
34*67e74705SXin Li@end
35*67e74705SXin Li
36*67e74705SXin Li@implementation C
37*67e74705SXin Li-(void) setX: (int) arg0 { } // expected-warning {{conflicting parameter types in declaration of 'setX:': 'float' vs 'int'}}
38*67e74705SXin Li+ (int) C {return 0;} // expected-warning {{conflicting return type in declaration of 'C': 'float' vs 'int'}}
39*67e74705SXin Li@end
40