blob: 148fa8ebb27fe8c54fb79bc31d439523beb6ba48 [file] [log] [blame]
Patrick Beardb2f68202012-04-06 18:12:22 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
Fariborz Jahanianacdc33b2009-01-19 20:13:47 +00002// Test that arithmatic types on property and its ivar have exact match.
3
4@interface Test4
5{
Fariborz Jahanian59ed9e42012-09-24 22:00:36 +00006 char ivar; // expected-note{{instance variable is declared here}}
Fariborz Jahanianacdc33b2009-01-19 20:13:47 +00007}
8@property int prop;
9@end
10
11@implementation Test4
Fariborz Jahanian59ed9e42012-09-24 22:00:36 +000012@synthesize prop = ivar; // expected-error {{type of property 'prop' ('int') does not match type of instance variable 'ivar' ('char')}}
Fariborz Jahanianacdc33b2009-01-19 20:13:47 +000013@end
14
Fariborz Jahanian74414712012-05-15 18:12:51 +000015
16@interface Test5
17{
Fariborz Jahanian59ed9e42012-09-24 22:00:36 +000018 void * _P; // expected-note {{instance variable is declared here}}
Fariborz Jahanian74414712012-05-15 18:12:51 +000019}
20@property int P;
21@end
22
23@implementation Test5
Fariborz Jahanian59ed9e42012-09-24 22:00:36 +000024@synthesize P=_P; // expected-error {{ype of property 'P' ('int') does not match type of instance variable '_P' ('void *')}}
Fariborz Jahanian74414712012-05-15 18:12:51 +000025@end
26