blob: a0d1c9da7b8052fb4870b2640448c4d87bda171f [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{
Ted Kremenekf921a482010-03-23 19:02:22 +00006 char ivar; // expected-note{{ivar is declared here}}
Fariborz Jahanianacdc33b2009-01-19 20:13:47 +00007}
8@property int prop;
9@end
10
11@implementation Test4
Ted Kremenekf921a482010-03-23 19:02:22 +000012@synthesize prop = ivar; // expected-error {{type of property 'prop' ('int') does not match type of ivar 'ivar' ('char')}}
Fariborz Jahanianacdc33b2009-01-19 20:13:47 +000013@end
14
Fariborz Jahanian74414712012-05-15 18:12:51 +000015
16@interface Test5
17{
18 void * _P; // expected-note {{ivar is declared here}}
19}
20@property int P;
21@end
22
23@implementation Test5
24@synthesize P=_P; // expected-error {{ype of property 'P' ('int') does not match type of ivar '_P' ('void *')}}
25@end
26