Patrick Beard | b2f6820 | 2012-04-06 18:12:22 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -fobjc-runtime-has-weak -fobjc-arc -verify -Wno-objc-root-class %s |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 2 | // rdar://8899430 |
| 3 | |
| 4 | @interface WeakPropertyTest { |
| 5 | Class isa; |
| 6 | __weak id value; |
Argyrios Kyrtzidis | 135aa60 | 2012-12-12 22:48:25 +0000 | [diff] [blame] | 7 | id x; // expected-error {{existing instance variable 'x' for __weak property 'x' must be __weak}} |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 8 | } |
| 9 | @property (weak) id value1; |
| 10 | @property __weak id value; |
| 11 | @property () __weak id value2; |
| 12 | |
| 13 | @property (weak, assign) id v1; // expected-error {{property attributes 'assign' and 'weak' are mutually exclusive}} |
| 14 | @property (weak, copy) id v2; // expected-error {{property attributes 'copy' and 'weak' are mutually exclusive}} |
| 15 | @property (weak, retain) id v3; // expected-error {{property attributes 'retain' and 'weak' are mutually exclusive}} |
| 16 | @property (weak, assign) id v4; // expected-error {{property attributes 'assign' and 'weak' are mutually exclusive}} |
| 17 | |
| 18 | @property () __weak id x; // expected-note {{property declared here}} |
| 19 | @end |
| 20 | |
| 21 | @implementation WeakPropertyTest |
Argyrios Kyrtzidis | 135aa60 | 2012-12-12 22:48:25 +0000 | [diff] [blame] | 22 | @synthesize x; // expected-note {{property synthesized here}} |
John McCall | f85e193 | 2011-06-15 23:02:42 +0000 | [diff] [blame] | 23 | @dynamic value1, value, value2, v1,v2,v3,v4; |
| 24 | @end |