blob: 829c082287474ecbee4dbcb6ceaa42f51eccca2e [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-gc -fsyntax-only -verify %s
Fariborz Jahanian62ac5d02010-05-18 23:04:17 +00002// RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fobjc-gc -fsyntax-only -verify %s
Fariborz Jahanian9bc77b22009-02-27 22:38:11 +00003
4@interface INTF
5{
6 id IVAR;
7 __weak id II;
8 __weak id WID;
9 id ID;
10 __weak INTF* AWEAK;
11 __weak INTF* WI;
12}
13@property (assign) __weak id pweak;
14@property (assign) __weak id WID;
Fariborz Jahanian62ac5d02010-05-18 23:04:17 +000015@property (assign) __strong id NOT;
Fariborz Jahanian9bc77b22009-02-27 22:38:11 +000016@property (assign) id ID;
17@property (assign) INTF* AWEAK;
18@property (assign) __weak INTF* WI;
19@end
20
21@implementation INTF
22@synthesize pweak=IVAR; // expected-error {{existing ivar 'IVAR' for __weak property 'pweak' must be __weak}}
John McCallf85e1932011-06-15 23:02:42 +000023@synthesize NOT=II; // expected-error {{existing ivar 'II' for strong property 'NOT' may not be __weak}}
Fariborz Jahanian9bc77b22009-02-27 22:38:11 +000024@synthesize WID;
25@synthesize ID;
John McCallf85e1932011-06-15 23:02:42 +000026@synthesize AWEAK; // expected-error {{existing ivar 'AWEAK' for strong property 'AWEAK' may not be __weak}}
Fariborz Jahanian9bc77b22009-02-27 22:38:11 +000027@synthesize WI;
28@end