summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 1f0dd8535a3..4b063c49c7e 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -1013,10 +1013,9 @@ static bool isCapturedBy(const VarDecl &var, const Expr *e) {
}
else if (DeclStmt *DS = dyn_cast<DeclStmt>((*BI))) {
// special case declarations
- for (DeclStmt::decl_iterator I = DS->decl_begin(), E = DS->decl_end();
- I != E; ++I) {
- if (VarDecl *VD = dyn_cast<VarDecl>((*I))) {
- Expr *Init = VD->getInit();
+ for (const auto *I : DS->decls()) {
+ if (const auto *VD = dyn_cast<VarDecl>((I))) {
+ const Expr *Init = VD->getInit();
if (Init && isCapturedBy(var, Init))
return true;
}
OpenPOWER on IntegriCloud