Fariborz Jahanian | 2576061 | 2010-02-15 21:55:26 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | @interface Foo |
Fariborz Jahanian | 80aa1cd | 2010-06-22 23:20:40 +0000 | [diff] [blame] | 4 | @property (readonly) char foo; // expected-note {{property declared here}} |
Ted Kremenek | 788f489 | 2010-10-21 18:49:42 +0000 | [diff] [blame^] | 5 | @property (readwrite) char bar; // expected-note {{property declared here}} |
Fariborz Jahanian | 2576061 | 2010-02-15 21:55:26 +0000 | [diff] [blame] | 6 | @end |
| 7 | |
| 8 | @interface Foo () |
Fariborz Jahanian | 80aa1cd | 2010-06-22 23:20:40 +0000 | [diff] [blame] | 9 | @property (readwrite) char foo; // OK |
| 10 | @property (readwrite) char NewProperty; // expected-note 2 {{property declared here}} |
Ted Kremenek | 788f489 | 2010-10-21 18:49:42 +0000 | [diff] [blame^] | 11 | @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 Jahanian | 2576061 | 2010-02-15 21:55:26 +0000 | [diff] [blame] | 12 | @end |
| 13 | |
| 14 | @interface Foo () |
Fariborz Jahanian | 80aa1cd | 2010-06-22 23:20:40 +0000 | [diff] [blame] | 15 | @property (readwrite) char foo; // OK again, make primary property readwrite for 2nd time! |
Ted Kremenek | 788f489 | 2010-10-21 18:49:42 +0000 | [diff] [blame^] | 16 | @property (readwrite) char NewProperty; // expected-error {{redeclaration of property in continuation class 'Foo' (attribute must be 'readwrite', while its primary must be 'readonly')}} |
Fariborz Jahanian | 2576061 | 2010-02-15 21:55:26 +0000 | [diff] [blame] | 17 | @end |
Fariborz Jahanian | 80aa1cd | 2010-06-22 23:20:40 +0000 | [diff] [blame] | 18 | |
| 19 | @interface Foo () |
Ted Kremenek | 788f489 | 2010-10-21 18:49:42 +0000 | [diff] [blame^] | 20 | @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 Jahanian | 80aa1cd | 2010-06-22 23:20:40 +0000 | [diff] [blame] | 22 | @end |
| 23 | |