2012-04-07 02:12:22 +08:00
|
|
|
// RUN: %clang_cc1 -Woverriding-method-mismatch -fsyntax-only -verify -Wno-objc-root-class %s
|
2011-08-09 02:03:17 +08:00
|
|
|
// rdar://6191214
|
|
|
|
|
|
|
|
@protocol Xint
|
2011-08-11 01:16:30 +08:00
|
|
|
-(void) setX: (int) arg0; // expected-note {{previous declaration is here}}
|
|
|
|
+(int) C; // expected-note {{previous declaration is here}}
|
2011-08-09 02:03:17 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol Xfloat
|
2011-08-11 01:16:30 +08:00
|
|
|
-(void) setX: (float) arg0; // expected-note 2 {{previous declaration is here}}
|
|
|
|
+(float) C; // expected-note 2 {{previous declaration is here}}
|
2011-08-09 02:03:17 +08:00
|
|
|
@end
|
|
|
|
|
2011-08-11 01:16:30 +08:00
|
|
|
@interface A <Xint, Xfloat>
|
2011-08-09 02:03:17 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation A
|
2011-08-11 01:16:30 +08:00
|
|
|
-(void) setX: (int) arg0 { } // expected-warning {{conflicting parameter types in declaration of 'setX:': 'float' vs 'int'}}
|
|
|
|
+(int) C {return 0; } // expected-warning {{conflicting return type in declaration of 'C': 'float' vs 'int'}}
|
2011-08-09 02:03:17 +08:00
|
|
|
@end
|
|
|
|
|
2011-08-11 01:16:30 +08:00
|
|
|
@interface B <Xfloat, Xint>
|
2011-08-09 02:03:17 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation B
|
2011-08-11 01:16:30 +08:00
|
|
|
-(void) setX: (float) arg0 { } // expected-warning {{conflicting parameter types in declaration of 'setX:': 'int' vs 'float'}}
|
|
|
|
+ (float) C {return 0.0; } // expected-warning {{conflicting return type in declaration of 'C': 'int' vs 'float'}}
|
2011-08-09 02:03:17 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol Xint_float<Xint, Xfloat>
|
|
|
|
@end
|
|
|
|
|
2011-08-11 01:16:30 +08:00
|
|
|
@interface C<Xint_float>
|
2011-08-09 02:03:17 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation C
|
2011-08-11 01:16:30 +08:00
|
|
|
-(void) setX: (int) arg0 { } // expected-warning {{conflicting parameter types in declaration of 'setX:': 'float' vs 'int'}}
|
|
|
|
+ (int) C {return 0;} // expected-warning {{conflicting return type in declaration of 'C': 'float' vs 'int'}}
|
2011-08-09 02:03:17 +08:00
|
|
|
@end
|