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:
parent
a7297be859
commit
3fef35736e
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue