Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Fariborz Jahanian | b16308f | 2008-11-26 20:33:54 +0000 | [diff] [blame] | 2 | |
| 3 | @interface ReadOnly |
| 4 | { |
| 5 | id _object; |
| 6 | id _object1; |
| 7 | } |
Fariborz Jahanian | cc667e2 | 2009-11-03 00:01:38 +0000 | [diff] [blame] | 8 | @property(readonly) id object; // expected-note {{property declared here}} |
Fariborz Jahanian | a6f14e1 | 2009-11-02 22:45:15 +0000 | [diff] [blame] | 9 | @property(readwrite, assign) id object1; // expected-note {{property declared here}} |
Fariborz Jahanian | d669be5 | 2009-11-06 22:59:12 +0000 | [diff] [blame] | 10 | @property (readonly) int indentLevel; |
Fariborz Jahanian | b16308f | 2008-11-26 20:33:54 +0000 | [diff] [blame] | 11 | @end |
| 12 | |
| 13 | @interface ReadOnly () |
Fariborz Jahanian | cc667e2 | 2009-11-03 00:01:38 +0000 | [diff] [blame] | 14 | @property(readwrite, copy) id object; // expected-warning {{property attribute in continuation class does not match the primary class}} |
Fariborz Jahanian | a6f14e1 | 2009-11-02 22:45:15 +0000 | [diff] [blame] | 15 | @property(readonly) id object1; // expected-error {{property declaration in continuation class of 'ReadOnly' is to change a 'readonly' property to 'readwrite'}} |
Fariborz Jahanian | d669be5 | 2009-11-06 22:59:12 +0000 | [diff] [blame] | 16 | @property (readwrite, assign) int indentLevel; // OK. assign the the default in any case. |
Fariborz Jahanian | b16308f | 2008-11-26 20:33:54 +0000 | [diff] [blame] | 17 | @end |
Fariborz Jahanian | a6f14e1 | 2009-11-02 22:45:15 +0000 | [diff] [blame] | 18 | |
| 19 | @protocol Proto |
| 20 | @property (copy) id fee; // expected-note {{property declared here}} |
| 21 | @end |
| 22 | |
| 23 | @protocol Foo<Proto> |
| 24 | @property (copy) id foo; // expected-note {{property declared here}} |
| 25 | @end |
| 26 | |
| 27 | @interface Bar <Foo> { |
| 28 | id _foo; |
| 29 | id _fee; |
| 30 | } |
| 31 | @end |
| 32 | |
| 33 | @interface Bar () |
| 34 | @property (copy) id foo; // expected-error {{property declaration in continuation class of 'Bar' is to change a 'readonly' property to 'readwrite'}} |
| 35 | @property (copy) id fee; // expected-error {{property declaration in continuation class of 'Bar' is to change a 'readonly' property to 'readwrite'}} |
| 36 | @end |
| 37 | |
| 38 | @implementation Bar |
| 39 | @synthesize foo = _foo; |
| 40 | @synthesize fee = _fee; |
| 41 | @end |
| 42 | |