2012-04-07 02:12:22 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
|
2010-11-09 10:16:57 +08:00
|
|
|
// rdar://7766184
|
2010-03-23 07:25:52 +08:00
|
|
|
|
|
|
|
@interface Foo @end
|
|
|
|
|
|
|
|
@interface Foo ()
|
|
|
|
@property (readonly) int bar;
|
|
|
|
@end
|
|
|
|
|
|
|
|
void FUNC () {
|
|
|
|
Foo *foo;
|
2011-10-26 01:37:35 +08:00
|
|
|
foo.bar = 0; // expected-error {{assignment to readonly property}}
|
2010-03-23 07:25:52 +08:00
|
|
|
}
|
|
|
|
|
2010-12-11 07:36:33 +08:00
|
|
|
// rdar://8747333
|
|
|
|
@class NSObject;
|
|
|
|
|
|
|
|
@interface rdar8747333 {
|
|
|
|
@private
|
|
|
|
NSObject *_bar;
|
|
|
|
NSObject *_baz;
|
2010-12-12 02:39:37 +08:00
|
|
|
NSObject *_bam;
|
2010-12-11 07:36:33 +08:00
|
|
|
}
|
|
|
|
- (NSObject *)baz;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface rdar8747333 ()
|
|
|
|
- (NSObject *)bar;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface rdar8747333 ()
|
|
|
|
@property (readwrite, assign) NSObject *bar;
|
|
|
|
@property (readwrite, assign) NSObject *baz;
|
2010-12-12 02:39:37 +08:00
|
|
|
@property (readwrite, assign) NSObject *bam;
|
|
|
|
@property (readwrite, assign) NSObject *warn;
|
2010-12-11 07:36:33 +08:00
|
|
|
@end
|
|
|
|
|
2010-12-12 02:39:37 +08:00
|
|
|
@interface rdar8747333 ()
|
|
|
|
- (NSObject *)bam;
|
2015-10-14 07:27:34 +08:00
|
|
|
- (NSObject *)warn;
|
|
|
|
- (void)setWarn : (NSObject *)val;
|
2010-12-12 02:39:37 +08:00
|
|
|
@end
|
|
|
|
|
2015-10-14 07:27:34 +08:00
|
|
|
@implementation rdar8747333
|
2010-12-11 07:36:33 +08:00
|
|
|
@synthesize bar = _bar;
|
|
|
|
@synthesize baz = _baz;
|
2010-12-12 02:39:37 +08:00
|
|
|
@synthesize bam = _bam;
|
|
|
|
@dynamic warn;
|
2010-12-11 07:36:33 +08:00
|
|
|
@end
|
2010-03-23 07:25:52 +08:00
|
|
|
|