2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2008-11-27 04:33:54 +08:00
|
|
|
|
|
|
|
@interface ReadOnly
|
|
|
|
{
|
|
|
|
id _object;
|
|
|
|
id _object1;
|
|
|
|
}
|
2009-11-03 08:01:38 +08:00
|
|
|
@property(readonly) id object; // expected-note {{property declared here}}
|
2009-11-03 06:45:15 +08:00
|
|
|
@property(readwrite, assign) id object1; // expected-note {{property declared here}}
|
2009-11-07 06:59:12 +08:00
|
|
|
@property (readonly) int indentLevel;
|
2008-11-27 04:33:54 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface ReadOnly ()
|
2009-11-03 08:01:38 +08:00
|
|
|
@property(readwrite, copy) id object; // expected-warning {{property attribute in continuation class does not match the primary class}}
|
2010-10-22 02:49:42 +08:00
|
|
|
@property(readonly) id object1; // expected-error {{illegal redeclaration of property in continuation class 'ReadOnly' (attribute must be 'readwrite', while its primary must be 'readonly')}}
|
2009-11-07 06:59:12 +08:00
|
|
|
@property (readwrite, assign) int indentLevel; // OK. assign the the default in any case.
|
2008-11-27 04:33:54 +08:00
|
|
|
@end
|
2009-11-03 06:45:15 +08:00
|
|
|
|
|
|
|
@protocol Proto
|
|
|
|
@property (copy) id fee; // expected-note {{property declared here}}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol Foo<Proto>
|
|
|
|
@property (copy) id foo; // expected-note {{property declared here}}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface Bar <Foo> {
|
|
|
|
id _foo;
|
|
|
|
id _fee;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface Bar ()
|
2010-10-22 02:49:42 +08:00
|
|
|
@property (copy) id foo; // expected-error {{illegal redeclaration of property in continuation class 'Bar' (attribute must be 'readwrite', while its primary must be 'readonly')}}
|
|
|
|
@property (copy) id fee; // expected-error {{illegal redeclaration of property in continuation class 'Bar' (attribute must be 'readwrite', while its primary must be 'readonly')}}
|
2009-11-03 06:45:15 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Bar
|
|
|
|
@synthesize foo = _foo;
|
|
|
|
@synthesize fee = _fee;
|
|
|
|
@end
|
|
|
|
|