2012-04-07 02:12:22 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
|
2009-12-16 07:59:41 +08:00
|
|
|
|
|
|
|
typedef struct NSSize {
|
|
|
|
int width;
|
|
|
|
struct {
|
|
|
|
int dim;
|
|
|
|
} inner;
|
|
|
|
} NSSize;
|
|
|
|
|
|
|
|
@interface Foo {
|
|
|
|
NSSize _size;
|
|
|
|
}
|
|
|
|
@property NSSize size;
|
|
|
|
@end
|
|
|
|
|
|
|
|
void foo() {
|
|
|
|
Foo *f;
|
2010-08-12 05:22:15 +08:00
|
|
|
f.size.width = 2.2; // expected-error {{expression is not assignable}}
|
|
|
|
f.size.inner.dim = 200; // expected-error {{expression is not assignable}}
|
2009-12-16 07:59:41 +08:00
|
|
|
}
|
2010-02-11 09:11:34 +08:00
|
|
|
|
|
|
|
// radar 7628953
|
|
|
|
|
|
|
|
@interface Gorf {
|
|
|
|
}
|
|
|
|
- (NSSize)size;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Gorf
|
|
|
|
- (void)MyView_sharedInit {
|
2010-08-12 05:22:15 +08:00
|
|
|
self.size.width = 2.2; // expected-error {{expression is not assignable}}
|
2010-02-11 09:11:34 +08:00
|
|
|
}
|
|
|
|
- (NSSize)size {}
|
|
|
|
@end
|