blob: e8a2389bbc0201cc0eef2930c2005e5107f60c46 [file] [log] [blame]
Fariborz Jahanian25760612010-02-15 21:55:26 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3@interface Foo
Fariborz Jahanian80aa1cd2010-06-22 23:20:40 +00004@property (readonly) char foo; // expected-note {{property declared here}}
Ted Kremenek788f4892010-10-21 18:49:42 +00005@property (readwrite) char bar; // expected-note {{property declared here}}
Fariborz Jahanian25760612010-02-15 21:55:26 +00006@end
7
8@interface Foo ()
Fariborz Jahanian80aa1cd2010-06-22 23:20:40 +00009@property (readwrite) char foo; // OK
10@property (readwrite) char NewProperty; // expected-note 2 {{property declared here}}
Ted Kremenek788f4892010-10-21 18:49:42 +000011@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?)}}
Fariborz Jahanian25760612010-02-15 21:55:26 +000012@end
13
14@interface Foo ()
Fariborz Jahanian80aa1cd2010-06-22 23:20:40 +000015@property (readwrite) char foo; // OK again, make primary property readwrite for 2nd time!
Ted Kremenek788f4892010-10-21 18:49:42 +000016@property (readwrite) char NewProperty; // expected-error {{redeclaration of property in continuation class 'Foo' (attribute must be 'readwrite', while its primary must be 'readonly')}}
Fariborz Jahanian25760612010-02-15 21:55:26 +000017@end
Fariborz Jahanian80aa1cd2010-06-22 23:20:40 +000018
19@interface Foo ()
Ted Kremenek788f4892010-10-21 18:49:42 +000020@property (readonly) char foo; // expected-error {{redeclaration of property in continuation class 'Foo' (attribute must be 'readwrite', while its primary must be 'readonly')}}
21@property (readwrite) char NewProperty; // expected-error {{redeclaration of property in continuation class 'Foo' (attribute must be 'readwrite', while its primary must be 'readonly')}}
Fariborz Jahanian80aa1cd2010-06-22 23:20:40 +000022@end
23