39 lines · plain
1// RUN: %clang_cc1 -Woverriding-method-mismatch -fsyntax-only -verify -Wno-objc-root-class %s2 3@protocol Xint4-(void) setX: (int) arg0; // expected-note {{previous declaration is here}}5+(int) C; // expected-note {{previous declaration is here}}6@end7 8@protocol Xfloat9-(void) setX: (float) arg0; // expected-note 2 {{previous declaration is here}}10+(float) C; // expected-note 2 {{previous declaration is here}}11@end12 13@interface A <Xint, Xfloat>14@end15 16@implementation A17-(void) setX: (int) arg0 { } // expected-warning {{conflicting parameter types in declaration of 'setX:': 'float' vs 'int'}}18+(int) C {return 0; } // expected-warning {{conflicting return type in declaration of 'C': 'float' vs 'int'}}19@end20 21@interface B <Xfloat, Xint>22@end23 24@implementation B 25-(void) setX: (float) arg0 { } // expected-warning {{conflicting parameter types in declaration of 'setX:': 'int' vs 'float'}}26+ (float) C {return 0.0; } // expected-warning {{conflicting return type in declaration of 'C': 'int' vs 'float'}}27@end28 29@protocol Xint_float<Xint, Xfloat>30@end31 32@interface C<Xint_float>33@end34 35@implementation C36-(void) setX: (int) arg0 { } // expected-warning {{conflicting parameter types in declaration of 'setX:': 'float' vs 'int'}}37+ (int) C {return 0;} // expected-warning {{conflicting return type in declaration of 'C': 'float' vs 'int'}}38@end39