Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when processing the Decl of an Objective-C foreach statement.

llvm-svn: 57209
This commit is contained in:
Ted Kremenek 2008-10-06 20:59:48 +00:00
parent a7297be859
commit 3fef35736e
1 changed files with 3 additions and 3 deletions

View File

@ -342,9 +342,9 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S)
if (const DeclStmt *SD = dyn_cast<DeclStmt>(S.getElement())) {
EmitStmt(SD);
ElementTy = cast<ValueDecl>(SD->getDecl())->getType();
DeclAddress = LocalDeclMap[SD->getDecl()];
const ScopedDecl* D = SD->getSolitaryDecl();
ElementTy = cast<ValueDecl>(D)->getType();
DeclAddress = LocalDeclMap[D];
} else {
ElementTy = cast<Expr>(S.getElement())->getType();
DeclAddress = 0;