2012-04-07 02:12:22 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
|
2008-11-27 04:33:54 +08:00
|
|
|
|
|
|
|
@interface ReadOnly
|
|
|
|
{
|
|
|
|
id _object;
|
|
|
|
id _object1;
|
|
|
|
}
|
2012-08-22 05:45:58 +08:00
|
|
|
@property(readonly) id object;
|
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 ()
|
2012-08-22 05:45:58 +08:00
|
|
|
@property(readwrite, copy) id object; // Ok. declaring memory model in class extension - primary has none.
|
2012-05-19 05:22:49 +08:00
|
|
|
@property(readonly) id object1; // expected-error {{illegal redeclaration of property in class extension 'ReadOnly' (attribute must be 'readwrite', while its primary must be 'readonly')}}
|
2012-07-23 16:59:39 +08:00
|
|
|
@property (readwrite, assign) int indentLevel; // OK. assign 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 ()
|
2012-05-19 05:22:49 +08:00
|
|
|
@property (copy) id foo; // expected-error {{illegal redeclaration of property in class extension 'Bar' (attribute must be 'readwrite', while its primary must be 'readonly')}}
|
|
|
|
@property (copy) id fee; // expected-error {{illegal redeclaration of property in class extension '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
|
|
|
|
|
2012-02-02 08:49:12 +08:00
|
|
|
// rdar://10752081
|
|
|
|
@interface MyOtherClass() // expected-error {{cannot find interface declaration for 'MyOtherClass'}}
|
|
|
|
{
|
|
|
|
id array;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation MyOtherClass // expected-warning {{cannot find interface declaration for 'MyOtherClass'}}
|
|
|
|
@end
|