r258505 - Try to pacify MSVC.

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 22 07:57:20 PST 2016


Fun fact: cl.exe refuses to compile this program:

#include <vector>
void f(std::vector<int> v) {
  for (int i : v)
    do {} while(false);
}

¯\_(ツ)_/¯

On Fri, Jan 22, 2016 at 10:49 AM, Nico Weber via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: nico
> Date: Fri Jan 22 09:49:53 2016
> New Revision: 258505
>
> URL: http://llvm.org/viewvc/llvm-project?rev=258505&view=rev
> Log:
> Try to pacify MSVC.
>
> I'm not sure why it needs these braces, but they help locally.
>
> Modified:
>     cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
>
> Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=258505&r1=258504&r2=258505&view=diff
>
> ==============================================================================
> --- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
> +++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Fri Jan 22 09:49:53
> 2016
> @@ -811,8 +811,9 @@ bool RecursiveASTVisitor<Derived>::Trave
>      TRY_TO(TraverseStmt(Init->getInit()));
>
>    if (Init->getNumArrayIndices() &&
> getDerived().shouldVisitImplicitCode())
> -    for (VarDecl *VD : Init->getArrayIndexes())
> +    for (VarDecl *VD : Init->getArrayIndexes()) {
>        TRY_TO(TraverseDecl(VD));
> +    }
>    return true;
>  }
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160122/fc9175ee/attachment.html>


More information about the cfe-commits mailing list