1 // RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -fblocks -fobjc-exceptions -verify -Wno-objc-root-class %s
4 id __weak myString; // expected-error {{existing instance variable 'myString' for strong property 'myString' may not be __weak}}
6 id __weak myString2; // expected-error {{existing instance variable 'myString2' for strong property 'myString2' may not be __weak}}
8 id StrongIvar5; // expected-error {{existing instance variable 'StrongIvar5' for __weak property 'myString5' must be __weak}}
10 @property (strong) id myString; // expected-note {{property declared here}}
11 @property (strong) id myString1;
12 @property (retain) id myString2; // expected-note {{property declared here}}
14 @property (weak) id myString3;
15 @property (weak) id myString4;
16 @property __weak id myString5; // expected-note {{property declared here}}
19 @implementation MyClass
20 @synthesize myString; // expected-note {{property synthesized here}}
21 @synthesize myString1 = StrongIvar; // OK
22 @synthesize myString2 = myString2; // expected-note {{property synthesized here}}
24 @synthesize myString3; // OK
25 @synthesize myString4; // OK
26 @synthesize myString5 = StrongIvar5; // expected-note {{property synthesized here}}
32 id __unsafe_unretained x; // expected-error {{existing instance variable 'x' for __weak property 'x' must be __weak}}
33 id __strong y; // expected-error {{existing instance variable 'y' for __weak property 'y' must be __weak}}
34 id __autoreleasing z; // expected-error {{instance variables cannot have __autoreleasing ownership}}
36 @property(weak) id x; // expected-note {{property declared here}}
37 @property(weak) id y; // expected-note {{property declared here}}
42 @synthesize x; // expected-note {{property synthesized here}}
43 @synthesize y; // expected-note {{property synthesized here}}
44 @synthesize z; // suppressed
49 // Minor FIXME: kill the redundant error
50 @property (strong) UndeclaredClass *test2; // expected-error {{unknown type name 'UndeclaredClass'}} expected-error {{must be of object type}}
57 @property (strong) id exception;
59 void test3(Test3 *t3) {