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

Piotr Padlewski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 14 06:46:19 PST 2016


Prazek added a comment.

There is still one more problem:

  /home/prazek/llvm/lib/Analysis/ScalarEvolution.cpp:2442:11: warning: use auto when initializing with a template cast to avoid duplicating the type name [modernize-use-auto]
    const auto **O = SCEVAllocator.Allocate<const SCEV *>(Ops.size());
          ^
          auto 

The same thing for normal casts, so I guess it is not only problem with this patch

  /home/prazek/llvm/lib/IR/User.cpp:156:3: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
  auto **HungOffOperandList = static_cast<Use **>(Storage);
  ^
  auto 

There is also problem with function pointers

  /home/prazek/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp:520:9: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
        int (*PF)(int, char **, const char **) =
        ^
        auto                                                                                                                                                                                                                             

So these problems occur for cast like functions and for cast. Do you see simple fix for it?


https://reviews.llvm.org/D27166





More information about the cfe-commits mailing list