diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-19 19:08:23 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-19 19:08:23 +0000 |
commit | 43e1b46d640e9e9c9faa784fe6a6d8252f4e776a (patch) | |
tree | af991b563e6b0836dadfe91124c554a9790e8346 /lib | |
parent | a25c4080a490ea2bab6f54094dd75b19eae83770 (diff) |
Fixes a bug in ivar lookup in the new objc's default
property synthesis mode, when dealing with legacy code.
Fixes //rdar: //8565343.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116846 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index f98aefcd56..50f023abc8 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1068,9 +1068,14 @@ static ObjCIvarDecl *SynthesizeProvisionalIvar(Sema &SemaRef, ObjCPropertyDecl *property = SemaRef.LookupPropertyDecl(IDecl, II); if (!property) return 0; - if (ObjCPropertyImplDecl *PIDecl = ClassImpDecl->FindPropertyImplDecl(II)) + if (ObjCPropertyImplDecl *PIDecl = ClassImpDecl->FindPropertyImplDecl(II)) { DynamicImplSeen = (PIDecl->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic); + // property implementation has a designated ivar. No need to assume a new + // one. + if (!DynamicImplSeen && PIDecl->getPropertyIvarDecl()) + return 0; + } if (!DynamicImplSeen) { QualType PropType = SemaRef.Context.getCanonicalType(property->getType()); ObjCIvarDecl *Ivar = ObjCIvarDecl::Create(SemaRef.Context, ClassImpDecl, |