blob: 661638c52e06923c40f067f71a45b1819078e63e [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}}
Fariborz Jahanian62ac5d02010-05-18 23:04:17 +000023@synthesize NOT=II; // expected-error {{existing ivar 'II' for a __strong property 'NOT' must be garbage collectable}}
Fariborz Jahanian9bc77b22009-02-27 22:38:11 +000024@synthesize WID;
25@synthesize ID;
26@synthesize AWEAK; // expected-error {{existing ivar 'AWEAK' for a __strong property 'AWEAK' must be garbage collectable}}
27@synthesize WI;
28@end