Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Steve Naroff | 87d3ef0 | 2008-11-17 22:29:32 +0000 | [diff] [blame] | 2 | |
| 3 | @interface Foo |
| 4 | - iMethod; |
| 5 | + cMethod; |
| 6 | @end |
| 7 | |
| 8 | @interface A |
| 9 | @end |
| 10 | |
| 11 | @interface B : A |
| 12 | - (void)instanceMethod; |
| 13 | + classMethod; |
| 14 | @end |
| 15 | |
| 16 | @implementation B |
| 17 | |
| 18 | - (void)instanceMethod { |
| 19 | [super iMethod]; // expected-warning{{method '-iMethod' not found (return type defaults to 'id')}} |
| 20 | } |
| 21 | |
| 22 | + classMethod { |
| 23 | [super cMethod]; // expected-warning{{method '+cMethod' not found (return type defaults to 'id')}} |
Mike Stump | d1969d8 | 2009-07-22 00:43:08 +0000 | [diff] [blame] | 24 | return 0; |
Steve Naroff | 87d3ef0 | 2008-11-17 22:29:32 +0000 | [diff] [blame] | 25 | } |
| 26 | @end |
Steve Naroff | 5cb93b8 | 2008-11-19 15:54:23 +0000 | [diff] [blame] | 27 | |
| 28 | @interface XX |
| 29 | - m; |
| 30 | @end |
| 31 | |
| 32 | void f(id super) { |
| 33 | [super m]; |
| 34 | } |
| 35 | void f0(int super) { |
Chris Lattner | 4018a28 | 2009-03-11 03:47:47 +0000 | [diff] [blame] | 36 | [super m]; // expected-warning{{receiver type 'int' is not 'id'}} \ |
Chris Lattner | 0c73f37 | 2009-03-09 21:19:16 +0000 | [diff] [blame] | 37 | expected-warning {{method '-m' not found (return type defaults to 'id')}} |
Steve Naroff | 5cb93b8 | 2008-11-19 15:54:23 +0000 | [diff] [blame] | 38 | } |
| 39 | void f1(int puper) { |
| 40 | [super m]; // expected-error{{use of undeclared identifier 'super'}} |
| 41 | } |