blob: dfac0d4286ea45cd102a28575f62dc82a9f8a3e2 [file] [log] [blame]
Patrick Beardb2f68202012-04-06 18:12:22 +00001// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-gc -fsyntax-only -verify -Wno-objc-root-class %s
2// RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fobjc-gc -fsyntax-only -verify -Wno-objc-root-class %s
Fariborz Jahanian9bc77b22009-02-27 22:38:11 +00003
4@interface INTF
5{
Fariborz Jahanian59ed9e42012-09-24 22:00:36 +00006 id IVAR; // expected-note {{instance variable is declared here}}
Fariborz Jahanian9bc77b22009-02-27 22:38:11 +00007 __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
Fariborz Jahanian59ed9e42012-09-24 22:00:36 +000022@synthesize pweak=IVAR; // expected-error {{existing instance variable 'IVAR' for __weak property 'pweak' must be __weak}}
23@synthesize NOT=II; // expected-error {{existing instance variable 'II' for strong property 'NOT' may not be __weak}}
Fariborz Jahanian9bc77b22009-02-27 22:38:11 +000024@synthesize WID;
25@synthesize ID;
Fariborz Jahanian59ed9e42012-09-24 22:00:36 +000026@synthesize AWEAK; // expected-error {{existing instance variable 'AWEAK' for strong property 'AWEAK' may not be __weak}}
Fariborz Jahanian9bc77b22009-02-27 22:38:11 +000027@synthesize WI;
28@end