xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/weak-property.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1  -fsyntax-only -fobjc-runtime-has-weak -fobjc-arc -verify -Wno-objc-root-class %s
2*f4a2713aSLionel Sambuc// rdar://8899430
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc@interface WeakPropertyTest {
5*f4a2713aSLionel Sambuc    Class isa;
6*f4a2713aSLionel Sambuc    __weak id value;
7*f4a2713aSLionel Sambuc    id x; // expected-error {{existing instance variable 'x' for __weak property 'x' must be __weak}}
8*f4a2713aSLionel Sambuc}
9*f4a2713aSLionel Sambuc@property (weak) id value1;
10*f4a2713aSLionel Sambuc@property __weak id value;
11*f4a2713aSLionel Sambuc@property () __weak id value2;
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambuc@property (weak, assign) id v1;  // expected-error {{property attributes 'assign' and 'weak' are mutually exclusive}}
14*f4a2713aSLionel Sambuc@property (weak, copy) id v2; // expected-error {{property attributes 'copy' and 'weak' are mutually exclusive}}
15*f4a2713aSLionel Sambuc@property (weak, retain) id v3; // expected-error {{property attributes 'retain' and 'weak' are mutually exclusive}}
16*f4a2713aSLionel Sambuc@property (weak, assign) id v4;  // expected-error {{property attributes 'assign' and 'weak' are mutually exclusive}}
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc@property () __weak id x; // expected-note {{property declared here}}
19*f4a2713aSLionel Sambuc@end
20*f4a2713aSLionel Sambuc
21*f4a2713aSLionel Sambuc@implementation WeakPropertyTest
22*f4a2713aSLionel Sambuc@synthesize x; // expected-note {{property synthesized here}}
23*f4a2713aSLionel Sambuc@dynamic value1, value, value2, v1,v2,v3,v4;
24*f4a2713aSLionel Sambuc@end
25