From 3e84bd27fa12433ebfd11d07b3a662e01dd76d56 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 14 Apr 2016 11:12:32 +0000 Subject: [PATCH] Reapply r258505 after r266254, this time with a comment to make it more sticky. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266290 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/RecursiveASTVisitor.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index 0bc80f7d99..9a11cec91f 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -840,8 +840,14 @@ bool RecursiveASTVisitor::TraverseConstructorInitializer( TRY_TO(TraverseStmt(Init->getInit())); if (getDerived().shouldVisitImplicitCode()) - for (VarDecl *VD : Init->getArrayIndices()) + // The braces for this one-line loop are required for MSVC2013. It + // refuses to compile + // for (int i : int_vec) + // do {} while(false); + // without braces on the for loop. + for (VarDecl *VD : Init->getArrayIndices()) { TRY_TO(TraverseDecl(VD)); + } return true; } -- 2.50.1