Extra Clang Tools 3.9 documentation

clang-tidy - modernize-use-bool-literals

«  modernize-use-auto   ::   Contents   ::   modernize-use-default  »

modernize-use-bool-literals

Finds integer literals which are cast to bool.

bool p = 1;
bool f = static_cast<bool>(1);
std::ios_base::sync_with_stdio(0);

// transforms to

bool p = true;
bool f = true;
std::ios_base::sync_with_stdio(false);

«  modernize-use-auto   ::   Contents   ::   modernize-use-default  »