blob: 3d95d2607f8e4b14a17d6a6032b2a87d11c6f369 [file] [log] [blame]
Fariborz Jahanian2514a302009-12-15 23:59:41 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
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