From 39741cecde917affbcbdfb2942ff1a9eae8f3488 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 6 Oct 2008 20:59:48 +0000 Subject: [PATCH] Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when processing the Decl of an Objective-C foreach statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57209 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGObjC.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index c389adba58..9849fb61b6 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -342,9 +342,9 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S) if (const DeclStmt *SD = dyn_cast(S.getElement())) { EmitStmt(SD); - - ElementTy = cast(SD->getDecl())->getType(); - DeclAddress = LocalDeclMap[SD->getDecl()]; + const ScopedDecl* D = SD->getSolitaryDecl(); + ElementTy = cast(D)->getType(); + DeclAddress = LocalDeclMap[D]; } else { ElementTy = cast(S.getElement())->getType(); DeclAddress = 0; -- 2.40.0