]> granicus.if.org Git - clang/commitdiff
Reapply r258505 after r266254, this time with a comment to make it more sticky.
authorNico Weber <nicolasweber@gmx.de>
Thu, 14 Apr 2016 11:12:32 +0000 (11:12 +0000)
committerNico Weber <nicolasweber@gmx.de>
Thu, 14 Apr 2016 11:12:32 +0000 (11:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266290 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/RecursiveASTVisitor.h

index 0bc80f7d99467cce4f1dc5f1d95360badbd22cdf..9a11cec91f8f6d071ff69ed3ed57638b0ce8c9aa 100644 (file)
@@ -840,8 +840,14 @@ bool RecursiveASTVisitor<Derived>::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;
 }