// Check that we have a valid, previously declared ivar for @synthesize
if (Synthesize) {
// @synthesize
- bool NoExplicitPropertyIvar = (!PropertyIvar);
if (!PropertyIvar)
PropertyIvar = PropertyId;
QualType PropType = Context.getCanonicalType(property->getType());
// a property implementation and to avoid future warnings.
}
else if (getLangOptions().ObjCNonFragileABI &&
- NoExplicitPropertyIvar && ClassDeclared != IDecl) {
+ ClassDeclared != IDecl) {
Diag(PropertyLoc, diag::error_ivar_in_superclass_use)
<< property->getDeclName() << Ivar->getDeclName()
<< ClassDeclared->getDeclName();
// RUN: clang-cc -fsyntax-only -triple x86_64-apple-darwin10 -verify %s
@interface Super {
- id value; // expected-note {{previously declared 'value' here}}
+ id value2; // expected-note {{previously declared 'value2' here}}
}
@property(retain) id value;
@property(retain) id value1;
+@property(retain) id prop;
@end
-@interface Sub : Super @end
+@interface Sub : Super
+{
+ id value;
+}
+@end
@implementation Sub
-@synthesize value; // expected-error {{property 'value' attempting to use ivar 'value' declared in in super class 'Super'}} // expected-note {{previous use is here}}
-@synthesize value1=value; // expected-error {{synthesized properties 'value1' and 'value' both claim ivar 'value'}}
+@synthesize value; // expected-note {{previous use is here}}
+@synthesize value1=value; // expected-error {{synthesized properties 'value1' and 'value' both claim ivar 'value'}}
+@synthesize prop=value2; // expected-error {{property 'prop' attempting to use ivar 'value2' declared in in super class 'Super'}}
@end