2010-02-16 05:55:26 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
|
|
|
|
@interface Foo
|
2010-06-23 07:20:40 +08:00
|
|
|
@property (readonly) char foo; // expected-note {{property declared here}}
|
2010-10-22 02:49:42 +08:00
|
|
|
@property (readwrite) char bar; // expected-note {{property declared here}}
|
2010-02-16 05:55:26 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface Foo ()
|
2010-06-23 07:20:40 +08:00
|
|
|
@property (readwrite) char foo; // OK
|
|
|
|
@property (readwrite) char NewProperty; // expected-note 2 {{property declared here}}
|
2010-10-22 02:49:42 +08:00
|
|
|
@property (readwrite) char bar; // expected-error{{illegal redeclaration of 'readwrite' property in continuation class 'Foo' (perhaps you intended this to be a 'readwrite' redeclaration of a 'readonly' public property?)}}
|
2010-02-16 05:55:26 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface Foo ()
|
2010-06-23 07:20:40 +08:00
|
|
|
@property (readwrite) char foo; // OK again, make primary property readwrite for 2nd time!
|
2010-10-22 02:49:42 +08:00
|
|
|
@property (readwrite) char NewProperty; // expected-error {{redeclaration of property in continuation class 'Foo' (attribute must be 'readwrite', while its primary must be 'readonly')}}
|
2010-02-16 05:55:26 +08:00
|
|
|
@end
|
2010-06-23 07:20:40 +08:00
|
|
|
|
|
|
|
@interface Foo ()
|
2010-10-22 02:49:42 +08:00
|
|
|
@property (readonly) char foo; // expected-error {{redeclaration of property in continuation class 'Foo' (attribute must be 'readwrite', while its primary must be 'readonly')}}
|
|
|
|
@property (readwrite) char NewProperty; // expected-error {{redeclaration of property in continuation class 'Foo' (attribute must be 'readwrite', while its primary must be 'readonly')}}
|
2010-06-23 07:20:40 +08:00
|
|
|
@end
|
|
|
|
|