[PATCH] D18821: Add modernize-bool-to-integer-conversion
Sean McBride via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 7 09:43:56 PDT 2016
On Thu, 7 Apr 2016 15:48:56 +0000, Alexander Kornienko via cfe-commits said:
>Actually, did you think about adding this as a clang diagnostic?
>
>Richard, what do you think about complaining in Clang about `int i =
>true;` kind of code?
If you don't mind a lurker interjecting... :) I think that'd be great. I work with an old C++ codebase that started before C++ had 'bool', and so it used 'int' instead. A warning for 'int i = true' would help to convert all those old 'ints' to 'bools'.
Cheers,
Sean
More information about the cfe-commits
mailing list