Improve the diagnostic for -Wcustom-atomic-properties. Suggestion by Fariborz!
[clang.git] / test / SemaObjC / property-not-lvalue.m
blob3d95d2607f8e4b14a17d6a6032b2a87d11c6f369
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 typedef struct NSSize {
4                 int width;
5                 struct {
6                   int dim;
7                 } inner;
8 } NSSize;
10 @interface Foo  {
11         NSSize _size;
13 @property NSSize size;
14 @end
16 void foo() { 
17         Foo *f;
18         f.size.width = 2.2; // expected-error {{expression is not assignable}}
19         f.size.inner.dim = 200; // expected-error {{expression is not assignable}}
22 // radar 7628953
24 @interface Gorf  {
26 - (NSSize)size;
27 @end
29 @implementation Gorf
30 - (void)MyView_sharedInit {
31     self.size.width = 2.2; // expected-error {{expression is not assignable}}
33 - (NSSize)size {}
34 @end