forked from OSchip/llvm-project
Don't error when doing default property synthesis
and some are already synthesized by user declaration. llvm-svn: 108341
This commit is contained in:
parent
75fbb3b5e5
commit
56a9d54de8
|
@ -930,6 +930,10 @@ void Sema::DefaultSynthesizeProperties (Scope *S, ObjCImplDecl* IMPDecl,
|
|||
Prop->getPropertyImplementation() == ObjCPropertyDecl::Optional ||
|
||||
IMPDecl->FindPropertyImplIvarDecl(Prop->getIdentifier()))
|
||||
continue;
|
||||
// Property may have been synthesized by user.
|
||||
if (IMPDecl->FindPropertyImplDecl(Prop->getIdentifier()))
|
||||
continue;
|
||||
|
||||
ActOnPropertyImplDecl(S, IMPDecl->getLocation(), IMPDecl->getLocation(),
|
||||
true, DeclPtrTy::make(IMPDecl),
|
||||
Prop->getIdentifier(), Prop->getIdentifier());
|
||||
|
|
|
@ -103,3 +103,15 @@
|
|||
@implementation C (Category) // expected-note 2 {{implementation is here}}
|
||||
@end
|
||||
|
||||
// Don't complain if a property is already @synthesized by usr.
|
||||
@interface D
|
||||
{
|
||||
}
|
||||
@property int PROP;
|
||||
@end
|
||||
|
||||
@implementation D
|
||||
- (int) Meth { return self.PROP; }
|
||||
@synthesize PROP=IVAR;
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in New Issue