Douglas Gregor | c5e77d5 | 2010-02-19 15:18:45 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Douglas Gregor | c5e77d5 | 2010-02-19 15:18:45 +0000 | [diff] [blame] | 2 | @interface I1 |
| 3 | - (void)method; |
| 4 | @end |
| 5 | |
| 6 | @implementation I1 |
| 7 | - (void)method { |
| 8 | struct x { }; |
Douglas Gregor | 2725ca8 | 2010-04-21 19:57:20 +0000 | [diff] [blame^] | 9 | [x method]; // expected-error{{receiver type 'x' is not an Objective-C class}} |
Douglas Gregor | c5e77d5 | 2010-02-19 15:18:45 +0000 | [diff] [blame] | 10 | } |
| 11 | @end |
Douglas Gregor | 36262b8 | 2010-02-19 16:08:35 +0000 | [diff] [blame] | 12 | |
| 13 | typedef struct { int x; } ivar; |
| 14 | |
| 15 | @interface I2 { |
| 16 | id ivar; |
| 17 | } |
| 18 | - (void)method; |
| 19 | + (void)method; |
| 20 | @end |
| 21 | |
| 22 | @implementation I2 |
| 23 | - (void)method { |
| 24 | [ivar method]; |
| 25 | } |
| 26 | + (void)method { |
Douglas Gregor | 2725ca8 | 2010-04-21 19:57:20 +0000 | [diff] [blame^] | 27 | [ivar method]; // expected-error{{receiver type 'ivar' (aka 'ivar') is not an Objective-C class}} |
Douglas Gregor | 36262b8 | 2010-02-19 16:08:35 +0000 | [diff] [blame] | 28 | } |
| 29 | @end |