summaryrefslogtreecommitdiffstats
path: root/lib/Sema
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-06-07 09:21:25 +0000
committered <ed@FreeBSD.org>2009-06-07 09:21:25 +0000
commit2ae812c77b393190175c91233c3348f526ddab1b (patch)
tree57fdd33d153490269ca615ac308de731d00669da /lib/Sema
parent265c92560db8af7e64dc328cb612076086a62bd1 (diff)
downloadFreeBSD-src-2ae812c77b393190175c91233c3348f526ddab1b.zip
FreeBSD-src-2ae812c77b393190175c91233c3348f526ddab1b.tar.gz
Import Clang r73021.
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 2500a8f..5d47516 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1996,10 +1996,15 @@ Sema::DeclPtrTy Sema::ActOnPropertyImplDecl(SourceLocation AtLoc,
ObjCInterfaceDecl *ClassDeclared;
Ivar = IDecl->lookupInstanceVariable(Context, PropertyIvar, ClassDeclared);
if (!Ivar) {
- Ivar = ObjCIvarDecl::Create(Context, CurContext, PropertyLoc,
+ DeclContext *EnclosingContext = cast_or_null<DeclContext>(IDecl);
+ assert(EnclosingContext &&
+ "null DeclContext for synthesized ivar - ActOnPropertyImplDecl");
+ Ivar = ObjCIvarDecl::Create(Context, EnclosingContext, PropertyLoc,
PropertyIvar, PropType,
ObjCIvarDecl::Public,
(Expr *)0);
+ Ivar->setLexicalDeclContext(IDecl);
+ IDecl->addDecl(Context, Ivar);
property->setPropertyIvarDecl(Ivar);
if (!getLangOptions().ObjCNonFragileABI)
Diag(PropertyLoc, diag::error_missing_property_ivar_decl) << PropertyId;
OpenPOWER on IntegriCloud