Adds new check to clang-tidy.
Check finds conversions from integer literal to bool.
staronj on Apr 3 2016, 9:26 AM.Authored by
So the testing on llvm shows mostly one case - using DEBUG macro like this:
/home/prazek/llvm/lib/Support/APInt.cpp:1656:9: warning: implicitly converting integer literal to bool inside macro, use bool literal instead [modernize-use-bool-literals]
DEBUG(dbgs() << " " << r[i]); ^
/home/prazek/llvm/include/llvm/Support/Debug.h:92:18: note: expanded from macro 'DEBUG'
/home/prazek/llvm/include/llvm/Support/Debug.h:69:48: note: expanded from macro 'DEBUG_WITH_TYPE'
Some programers maybe would like to supress this in the case of expressions like while(1), or specially when it is inside macro.
Check now finds implicit and explicit conversions from integer literal to bool.
Added tests with templates and macros.