diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-08-24 18:48:05 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-08-24 18:48:05 +0000 |
commit | 76b35379f5f74d69ec221e84ff1dfcdc84cb3d12 (patch) | |
tree | 89fb08ab5f0d7b0a724b813ebc5138fd2bcea651 /clang/lib | |
parent | f2b1419acc8772551bdb64929739be23e4f9cae2 (diff) | |
download | bcm5719-llvm-76b35379f5f74d69ec221e84ff1dfcdc84cb3d12.tar.gz bcm5719-llvm-76b35379f5f74d69ec221e84ff1dfcdc84cb3d12.zip |
Fix a bug in nonfragile-abi2 when attempting to diagnose
previous use of a synthesized 'ivar' with property of same name
declared as @dynamic. In this case, 'ivar' is in the
inherited class and no diagnostics should be issued.
llvm-svn: 111940
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index ccb9a15ff25..91f47ab7082 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -521,7 +521,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, if (getLangOptions().ObjCNonFragileABI2) { // Diagnose if an ivar was lazily synthesdized due to a previous // use and if 1) property is @dynamic or 2) property is synthesized - // but it requires a dirreferently named ivar. + // but it requires an ivar of different name. ObjCInterfaceDecl *ClassDeclared; ObjCIvarDecl *Ivar = 0; if (!Synthesize) @@ -530,7 +530,9 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, if (PropertyIvar && PropertyIvar != PropertyId) Ivar = IDecl->lookupInstanceVariable(PropertyId, ClassDeclared); } - if (Ivar && Ivar->getSynthesize()) { + // Issue diagnostics only if Ivar belongs to current class. + if (Ivar && Ivar->getSynthesize() && + IC->getClassInterface() == ClassDeclared) { Diag(Ivar->getLocation(), diag::err_undeclared_var_use) << PropertyId; Ivar->setInvalidDecl(); |