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;
|
2013-03-27 08:02:21 +08:00
|
|
|
- (NSObject *)warn; // expected-note {{method 'warn' declared here}}
|
|
|
|
- (void)setWarn : (NSObject *)val; // expected-note {{method 'setWarn:' declared here}}
|
2010-12-12 02:39:37 +08:00
|
|
|
@end
|
|
|
|
|
2013-03-27 08:02:21 +08:00
|
|
|
@implementation rdar8747333 // expected-warning {{method definition for 'warn' not found}} \
|
|
|
|
// expected-warning {{method definition for 'setWarn:' not found}}
|
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
|
|
|
|