blob: d306a924e9b4634ac7f893dcb49ab891f7983196 [file] [log] [blame]
Patrick Beardb2f68202012-04-06 18:12:22 +00001// RUN: %clang_cc1 -fsyntax-only -fobjc-runtime-has-weak -fobjc-arc -verify -Wno-objc-root-class %s
John McCallf85e1932011-06-15 23:02:42 +00002// rdar://8899430
3
4@interface WeakPropertyTest {
5 Class isa;
6 __weak id value;
Argyrios Kyrtzidis135aa602012-12-12 22:48:25 +00007 id x; // expected-error {{existing instance variable 'x' for __weak property 'x' must be __weak}}
John McCallf85e1932011-06-15 23:02:42 +00008}
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 Kyrtzidis135aa602012-12-12 22:48:25 +000022@synthesize x; // expected-note {{property synthesized here}}
John McCallf85e1932011-06-15 23:02:42 +000023@dynamic value1, value, value2, v1,v2,v3,v4;
24@end