Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Fariborz Jahanian | a8ef2ec | 2008-12-05 18:38:31 +0000 | [diff] [blame] | 2 | |
Fariborz Jahanian | 8daab97 | 2008-12-05 18:18:52 +0000 | [diff] [blame] | 3 | @interface A |
| 4 | - (void) setMoo: (int) x; // expected-note {{previous definition is here}} |
| 5 | - (int) setMoo1: (int) x; // expected-note {{previous definition is here}} |
| 6 | - (int) setOk : (int) x : (double) d; |
| 7 | @end |
| 8 | |
| 9 | @implementation A |
Chris Lattner | 3aff919 | 2009-04-11 19:58:42 +0000 | [diff] [blame] | 10 | -(void) setMoo: (float) x {} // expected-warning {{conflicting parameter types in implementation of 'setMoo:': 'int' vs 'float'}} |
Mike Stump | d1969d8 | 2009-07-22 00:43:08 +0000 | [diff] [blame] | 11 | - (char) setMoo1: (int) x { return 0; } // expected-warning {{conflicting return type in implementation of 'setMoo1:': 'int' vs 'char'}} |
| 12 | - (int) setOk : (int) x : (double) d { return 0; } |
Fariborz Jahanian | 8daab97 | 2008-12-05 18:18:52 +0000 | [diff] [blame] | 13 | @end |
| 14 | |
| 15 | |
| 16 | |
| 17 | @interface C |
Chris Lattner | 3aff919 | 2009-04-11 19:58:42 +0000 | [diff] [blame] | 18 | + (void) cMoo: (int) x; // expected-note 2 {{previous definition is here}} |
Fariborz Jahanian | 8daab97 | 2008-12-05 18:18:52 +0000 | [diff] [blame] | 19 | @end |
| 20 | |
| 21 | @implementation C |
Chris Lattner | 3aff919 | 2009-04-11 19:58:42 +0000 | [diff] [blame] | 22 | +(float) cMoo: // expected-warning {{conflicting return type in implementation of 'cMoo:': 'void' vs 'float'}} |
Mike Stump | d1969d8 | 2009-07-22 00:43:08 +0000 | [diff] [blame] | 23 | (float) x { return 0; } // expected-warning {{conflicting parameter types in implementation of 'cMoo:': 'int' vs 'float'}} |
Fariborz Jahanian | 8daab97 | 2008-12-05 18:18:52 +0000 | [diff] [blame] | 24 | @end |
| 25 | |
| 26 | |
| 27 | @interface A(CAT) |
Chris Lattner | 3aff919 | 2009-04-11 19:58:42 +0000 | [diff] [blame] | 28 | - (void) setCat: (int) x; // expected-note 2 {{previous definition is here}} |
Fariborz Jahanian | 8daab97 | 2008-12-05 18:18:52 +0000 | [diff] [blame] | 29 | + (void) cCat: (int) x; // expected-note {{previous definition is here}} |
| 30 | @end |
| 31 | |
| 32 | @implementation A(CAT) |
Chris Lattner | 3aff919 | 2009-04-11 19:58:42 +0000 | [diff] [blame] | 33 | -(float) setCat: // expected-warning {{conflicting return type in implementation of 'setCat:': 'void' vs 'float'}} |
Mike Stump | d1969d8 | 2009-07-22 00:43:08 +0000 | [diff] [blame] | 34 | (float) x { return 0; } // expected-warning {{conflicting parameter types in implementation of 'setCat:': 'int' vs 'float'}} |
| 35 | + (int) cCat: (int) x { return 0; } // expected-warning {{conflicting return type in implementation of 'cCat:': 'void' vs 'int'}} |
Fariborz Jahanian | 8daab97 | 2008-12-05 18:18:52 +0000 | [diff] [blame] | 36 | @end |