John McCall | 18cadfc | 2010-10-28 02:34:38 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -Wmethod-signatures -fsyntax-only -verify %s |
David Chisnall | b2e3cb4 | 2010-10-25 17:23:52 +0000 | [diff] [blame] | 2 | |
John McCall | 18cadfc | 2010-10-28 02:34:38 +0000 | [diff] [blame] | 3 | @class B; |
David Chisnall | b2e3cb4 | 2010-10-25 17:23:52 +0000 | [diff] [blame] | 4 | @interface A |
John McCall | 18cadfc | 2010-10-28 02:34:38 +0000 | [diff] [blame] | 5 | - (B*)obj; |
| 6 | - (B*)a; // expected-note {{previous definition is here}} |
David Chisnall | b2e3cb4 | 2010-10-25 17:23:52 +0000 | [diff] [blame] | 7 | - (void)takesA: (A*)a; // expected-note {{previous definition is here}} |
| 8 | - (void)takesId: (id)a; // expected-note {{previous definition is here}} |
| 9 | @end |
| 10 | |
| 11 | |
| 12 | @interface B : A |
| 13 | @end |
| 14 | |
| 15 | @implementation B |
John McCall | 18cadfc | 2010-10-28 02:34:38 +0000 | [diff] [blame] | 16 | - (id)obj {return self;} // 'id' overrides are white-listed? |
| 17 | - (A*)a { return self;} // expected-warning {{conflicting return type in implementation of 'a'}} |
David Chisnall | b2e3cb4 | 2010-10-25 17:23:52 +0000 | [diff] [blame] | 18 | - (void)takesA: (B*)a // expected-warning {{conflicting parameter types in implementation of 'takesA:'}} |
| 19 | {} |
| 20 | - (void)takesId: (B*)a // expected-warning {{conflicting parameter types in implementation of 'takesId:'}} |
| 21 | {} |
| 22 | @end |