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