2010-02-19 23:18:45 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
@interface I1
|
|
|
|
- (void)method;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation I1
|
|
|
|
- (void)method {
|
|
|
|
struct x { };
|
|
|
|
[x method]; // expected-error{{invalid receiver to message expression}}
|
|
|
|
}
|
|
|
|
@end
|
2010-02-20 00:08:35 +08:00
|
|
|
|
|
|
|
typedef struct { int x; } ivar;
|
|
|
|
|
|
|
|
@interface I2 {
|
|
|
|
id ivar;
|
|
|
|
}
|
|
|
|
- (void)method;
|
|
|
|
+ (void)method;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation I2
|
|
|
|
- (void)method {
|
|
|
|
[ivar method];
|
|
|
|
}
|
|
|
|
+ (void)method {
|
|
|
|
[ivar method]; // expected-error{{invalid receiver to message expression}}
|
|
|
|
}
|
|
|
|
@end
|