2012-04-07 02:12:22 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
|
2010-10-20 03:08:23 +08:00
|
|
|
|
|
|
|
// rdar:// 8565343
|
|
|
|
@interface Foo {
|
|
|
|
@private
|
|
|
|
int _foo;
|
|
|
|
int _foo2;
|
|
|
|
}
|
|
|
|
@property (readwrite, nonatomic) int foo, foo1, foo2, foo3;
|
|
|
|
@property (readwrite, nonatomic) int PROP;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Foo
|
|
|
|
|
|
|
|
@synthesize foo = _foo;
|
|
|
|
@synthesize foo1;
|
|
|
|
|
2011-08-02 06:39:49 +08:00
|
|
|
- (void)setFoo:(int)value {
|
2010-10-20 03:08:23 +08:00
|
|
|
_foo = foo; // expected-error {{use of undeclared identifier 'foo'}}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setFoo1:(int)value {
|
|
|
|
_foo = foo1; // OK
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setFoo2:(int)value {
|
|
|
|
_foo = foo2; // expected-error {{use of undeclared identifier 'foo2'}}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setFoo3:(int)value {
|
|
|
|
_foo = foo3; // OK
|
|
|
|
}
|
|
|
|
|
2011-08-02 06:39:49 +08:00
|
|
|
@synthesize foo2 = _foo2;
|
|
|
|
@synthesize foo3;
|
2010-10-20 03:08:23 +08:00
|
|
|
|
2011-08-02 06:39:49 +08:00
|
|
|
@synthesize PROP=PROP;
|
2010-10-20 03:08:23 +08:00
|
|
|
- (void)setPROP:(int)value {
|
2012-06-29 07:53:12 +08:00
|
|
|
PROP = value; // OK
|
2010-10-20 03:08:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|