[PATCH] D27166: [clang-tidy] Enhance modernize-use-auto to templated function casts

Malcolm Parsons via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 14 06:36:29 PST 2016

malcolm.parsons added a comment.

In https://reviews.llvm.org/D27166#622072, @Prazek wrote:

> Have you run this check on LLVM & Clang to check if it works?

I ran it on some of clang-tools-extra:

  -    const VarDecl *Var = Result.Nodes.getNodeAs<VarDecl>("var");
  +    const auto *Var = Result.Nodes.getNodeAs<VarDecl>("var");

>   lib/Analysis/AssumptionCache.cpp:120
>   -    for (const BasicBlock &B : cast<Function>(*I.first))
>   +    for (const BasicBlock &B : auto<Function>(*I.first))

The check should be ignoring implicit VarDecls.


More information about the cfe-commits mailing list