DIAG(error_bad_property_context, ERROR,
"property implementation must be in a class or category implementation")
DIAG(error_bad_property_decl, ERROR,
- "property implementation must have its declaration in the class '%0'")
+ "property implementation must have its declaration in interface '%0'")
DIAG(error_bad_category_property_decl, ERROR,
"property implementation must have its declaration in the category '%0'")
DIAG(error_property_ivar_decl, ERROR,
DIAG(error_missing_property_interface, ERROR,
"property implementation in a category with no category declaration")
DIAG(error_missing_property_ivar_decl, ERROR,
- "property synthesize requires a previously declared ivar")
+ "synthesized property '%0' must either be named the same as a compatible"
+ " ivar or must explicitly name an ivar")
DIAG(error_synthesize_category_decl, ERROR,
"@synthesize not allowed in a category's implementation")
DIAG(error_property_ivar_type, ERROR,
// Check that we have a valid, previously declared ivar for @synthesize
if (Synthesize) {
// @synthesize
- if (!PropertyIvar) {
- Diag(PropertyLoc, diag::error_property_ivar_decl);
- return 0;
- }
+ if (!PropertyIvar)
+ PropertyIvar = PropertyId;
// Check that this is a previously declared 'ivar' in 'IDecl' interface
ObjCIvarDecl *Ivar = IDecl->FindIvarDeclaration(PropertyIvar);
if (!Ivar) {
- Diag(PropertyLoc, diag::error_missing_property_ivar_decl);
+ Diag(PropertyLoc, diag::error_missing_property_ivar_decl,
+ PropertyId->getName());
return 0;
}
// Check that type of property and its ivar match.
@interface I
{
int IVAR;
+ int name;
}
@property int d1;
@property id prop_id;
+@property int name;
@end
@interface I(CAT)
@end
@implementation I
-@synthesize d1; // expected-error {{property synthesize requires specification of an ivar}}
-@dynamic bad; // expected-error {{property implementation must have its declaration in the class 'I'}}
-@synthesize prop_id; // expected-error {{property synthesize requires specification of an ivar}}
+@synthesize d1; // expected-error {{synthesized property 'd1' must either be named the same as}}
+@dynamic bad; // expected-error {{property implementation must have its declaration in interface 'I'}}
+@synthesize prop_id; // expected-error {{synthesized property 'prop_id' must either be named the same}}
@synthesize prop_id = IVAR; // expected-error {{type of property 'prop_id' does not match type of ivar 'IVAR'}}
+@synthesize name; // OK! property with same name as an accessible ivar of same name
@end
@implementation I(CAT)
@end
@implementation E // expected-warning {{cannot find interface declaration for 'E'}}
-@dynamic d; // expected-error {{property implementation must have its declaration in the class 'E'}}
+@dynamic d; // expected-error {{property implementation must have its declaration in interface 'E'}}
@end
@implementation Q(MYCAT) // expected-error {{cannot find interface declaration for 'Q'}}