From 2ae812c77b393190175c91233c3348f526ddab1b Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 7 Jun 2009 09:21:25 +0000 Subject: Import Clang r73021. --- lib/Sema/SemaDeclObjC.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/Sema') 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(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; -- cgit v1.1