[PATCH] D45601: Warn on bool* to bool conversion

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 13 02:52:46 PDT 2018


lebedev.ri added a comment.

@hiraditya I personally don't like when i'm being told so, but i'd like to see some numbers...
**Please** run this on //some// big C++ project (LLVM (but you'll have to enable this diag specifically), google chrome, ???), and analyse the results.

In https://reviews.llvm.org/D45601#1066572, @Eugene.Zelenko wrote:

> There is Clang-tidy's readability-implicit-bool-conversion <http://clang.llvm.org/extra/clang-tidy/checks/readability-implicit-bool-conversion.html> check.
>
> It may be reasonable to check pointers to integers too, since integers are often implicitly converted to bools.


While warning on `bool*`->`bool` *might* be ok, also warning for all `inttype*`->`bool` will likely be *too* noisy for clang diagnostic.


https://reviews.llvm.org/D45601





More information about the cfe-commits mailing list