Patrick Beard | b2f6820 | 2012-04-06 18:12:22 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -Woverriding-method-mismatch -fsyntax-only -verify -Wno-objc-root-class %s |
Fariborz Jahanian | 2112190 | 2011-08-08 18:03:17 +0000 | [diff] [blame] | 2 | // rdar://6191214 |
| 3 | |
| 4 | @protocol Xint |
Fariborz Jahanian | 730cfb1 | 2011-08-10 17:16:30 +0000 | [diff] [blame] | 5 | -(void) setX: (int) arg0; // expected-note {{previous declaration is here}} |
| 6 | +(int) C; // expected-note {{previous declaration is here}} |
Fariborz Jahanian | 2112190 | 2011-08-08 18:03:17 +0000 | [diff] [blame] | 7 | @end |
| 8 | |
| 9 | @protocol Xfloat |
Fariborz Jahanian | 730cfb1 | 2011-08-10 17:16:30 +0000 | [diff] [blame] | 10 | -(void) setX: (float) arg0; // expected-note 2 {{previous declaration is here}} |
| 11 | +(float) C; // expected-note 2 {{previous declaration is here}} |
Fariborz Jahanian | 2112190 | 2011-08-08 18:03:17 +0000 | [diff] [blame] | 12 | @end |
| 13 | |
Fariborz Jahanian | 730cfb1 | 2011-08-10 17:16:30 +0000 | [diff] [blame] | 14 | @interface A <Xint, Xfloat> |
Fariborz Jahanian | 2112190 | 2011-08-08 18:03:17 +0000 | [diff] [blame] | 15 | @end |
| 16 | |
| 17 | @implementation A |
Fariborz Jahanian | 730cfb1 | 2011-08-10 17:16:30 +0000 | [diff] [blame] | 18 | -(void) setX: (int) arg0 { } // expected-warning {{conflicting parameter types in declaration of 'setX:': 'float' vs 'int'}} |
| 19 | +(int) C {return 0; } // expected-warning {{conflicting return type in declaration of 'C': 'float' vs 'int'}} |
Fariborz Jahanian | 2112190 | 2011-08-08 18:03:17 +0000 | [diff] [blame] | 20 | @end |
| 21 | |
Fariborz Jahanian | 730cfb1 | 2011-08-10 17:16:30 +0000 | [diff] [blame] | 22 | @interface B <Xfloat, Xint> |
Fariborz Jahanian | 2112190 | 2011-08-08 18:03:17 +0000 | [diff] [blame] | 23 | @end |
| 24 | |
| 25 | @implementation B |
Fariborz Jahanian | 730cfb1 | 2011-08-10 17:16:30 +0000 | [diff] [blame] | 26 | -(void) setX: (float) arg0 { } // expected-warning {{conflicting parameter types in declaration of 'setX:': 'int' vs 'float'}} |
| 27 | + (float) C {return 0.0; } // expected-warning {{conflicting return type in declaration of 'C': 'int' vs 'float'}} |
Fariborz Jahanian | 2112190 | 2011-08-08 18:03:17 +0000 | [diff] [blame] | 28 | @end |
| 29 | |
| 30 | @protocol Xint_float<Xint, Xfloat> |
| 31 | @end |
| 32 | |
Fariborz Jahanian | 730cfb1 | 2011-08-10 17:16:30 +0000 | [diff] [blame] | 33 | @interface C<Xint_float> |
Fariborz Jahanian | 2112190 | 2011-08-08 18:03:17 +0000 | [diff] [blame] | 34 | @end |
| 35 | |
| 36 | @implementation C |
Fariborz Jahanian | 730cfb1 | 2011-08-10 17:16:30 +0000 | [diff] [blame] | 37 | -(void) setX: (int) arg0 { } // expected-warning {{conflicting parameter types in declaration of 'setX:': 'float' vs 'int'}} |
| 38 | + (int) C {return 0;} // expected-warning {{conflicting return type in declaration of 'C': 'float' vs 'int'}} |
Fariborz Jahanian | 2112190 | 2011-08-08 18:03:17 +0000 | [diff] [blame] | 39 | @end |