blob: 0d5bef8bb7a7d0376b20616215ceb8dc27b6863d [file] [log] [blame]
Douglas Gregorc5e77d52010-02-19 15:18:45 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Douglas Gregorc5e77d52010-02-19 15:18:45 +00002@interface I1
3- (void)method;
4@end
5
6@implementation I1
7- (void)method {
8 struct x { };
Douglas Gregor2725ca82010-04-21 19:57:20 +00009 [x method]; // expected-error{{receiver type 'x' is not an Objective-C class}}
Douglas Gregorc5e77d52010-02-19 15:18:45 +000010}
11@end
Douglas Gregor36262b82010-02-19 16:08:35 +000012
13typedef 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 Gregor2725ca82010-04-21 19:57:20 +000027 [ivar method]; // expected-error{{receiver type 'ivar' (aka 'ivar') is not an Objective-C class}}
Douglas Gregor36262b82010-02-19 16:08:35 +000028}
29@end