diff options
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 6e65e88bce..6be6fcedd3 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -875,6 +875,9 @@ static bool isCapturedBy(const VarDecl &var, const Expr *e) { return false; } + if (const StmtExpr *SE = dyn_cast<StmtExpr>(e)) + e = cast<Expr>(SE->getSubStmt()->body_back()); + for (Stmt::const_child_range children = e->children(); children; ++children) if (isCapturedBy(var, cast<Expr>(*children))) return true; |