Home | History | Annotate | Download | only in SemaObjC
      1 // RUN: %clang_cc1  -fsyntax-only -verify -Wno-objc-root-class %s
      2 
      3 // rdar:// 8565343
      4 @interface Foo  {
      5 @private
      6     int _foo;
      7     int _foo2;
      8 }
      9 @property (readwrite, nonatomic) int foo, foo1, foo2, foo3;
     10 @property (readwrite, nonatomic) int PROP;
     11 @end
     12 
     13 @implementation Foo
     14 
     15 @synthesize foo = _foo;
     16 @synthesize foo1;
     17 
     18 - (void)setFoo:(int)value {
     19     _foo = foo; // expected-error {{use of undeclared identifier 'foo'}}
     20 }
     21 
     22 - (void)setFoo1:(int)value {
     23     _foo = foo1; // OK
     24 }
     25 
     26 - (void)setFoo2:(int)value {
     27     _foo = foo2; // expected-error {{use of undeclared identifier 'foo2'}}
     28 }
     29 
     30 - (void)setFoo3:(int)value {
     31     _foo = foo3;	// OK
     32 }
     33 
     34 @synthesize foo2 = _foo2;
     35 @synthesize foo3;
     36 
     37 @synthesize PROP=PROP;
     38 - (void)setPROP:(int)value {
     39     PROP = value;        // OK
     40 }
     41 
     42 @end
     43 
     44