2012-04-07 02:12:22 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
|
2018-04-06 23:14:32 +08:00
|
|
|
// Test that arithmetic types on property and its ivar have exact match.
|
2009-01-20 04:13:47 +08:00
|
|
|
|
|
|
|
@interface Test4
|
|
|
|
{
|
2012-09-25 06:00:36 +08:00
|
|
|
char ivar; // expected-note{{instance variable is declared here}}
|
2009-01-20 04:13:47 +08:00
|
|
|
}
|
|
|
|
@property int prop;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Test4
|
2012-09-25 06:00:36 +08:00
|
|
|
@synthesize prop = ivar; // expected-error {{type of property 'prop' ('int') does not match type of instance variable 'ivar' ('char')}}
|
2009-01-20 04:13:47 +08:00
|
|
|
@end
|
|
|
|
|
2012-05-16 02:12:51 +08:00
|
|
|
|
|
|
|
@interface Test5
|
|
|
|
{
|
2012-09-25 06:00:36 +08:00
|
|
|
void * _P; // expected-note {{instance variable is declared here}}
|
2012-05-16 02:12:51 +08:00
|
|
|
}
|
|
|
|
@property int P;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Test5
|
2012-09-25 06:00:36 +08:00
|
|
|
@synthesize P=_P; // expected-error {{ype of property 'P' ('int') does not match type of instance variable '_P' ('void *')}}
|
2012-05-16 02:12:51 +08:00
|
|
|
@end
|
|
|
|
|