blob: 12d2cc62ff47741448c4ce8144e6c993c4eefce4 [file] [log] [blame]
Patrick Beardb2f68202012-04-06 18:12:22 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
Fariborz Jahanian2514a302009-12-15 23:59:41 +00002
3typedef struct NSSize {
4 int width;
5 struct {
6 int dim;
7 } inner;
8} NSSize;
9
10@interface Foo {
11 NSSize _size;
12}
13@property NSSize size;
14@end
15
16void foo() {
17 Foo *f;
Fariborz Jahanian741c3622010-08-11 21:22:15 +000018 f.size.width = 2.2; // expected-error {{expression is not assignable}}
19 f.size.inner.dim = 200; // expected-error {{expression is not assignable}}
Fariborz Jahanian2514a302009-12-15 23:59:41 +000020}
Fariborz Jahaniane9ff4432010-02-11 01:11:34 +000021
22// radar 7628953
23
24@interface Gorf {
25}
26- (NSSize)size;
27@end
28
29@implementation Gorf
30- (void)MyView_sharedInit {
Fariborz Jahanian741c3622010-08-11 21:22:15 +000031 self.size.width = 2.2; // expected-error {{expression is not assignable}}
Fariborz Jahaniane9ff4432010-02-11 01:11:34 +000032}
33- (NSSize)size {}
34@end