Commit Graph

5 Commits

Author SHA1 Message Date
David Bolvansky aaea76ba02 [Diagnostics] Emit better -Wbool-operation's warning message if we known that the result is always true
llvm-svn: 373973
2019-10-07 21:57:03 +00:00
David Bolvansky 559265c8da [Diagnostics] Use Expr::isKnownToHaveBooleanValue() to check bitwise negation of bool in languages without a bool type
Thanks for this advice, Richard Trieu!

llvm-svn: 373817
2019-10-05 08:02:11 +00:00
Sam McCall f44ca7f6eb Further improve -Wbool-operation bitwise negation message
llvm-svn: 373749
2019-10-04 14:11:05 +00:00
David Bolvansky 5e851ad6c1 [NFCI] Improve the -Wbool-operation's warning message
Based on the request from the post commit review. Also added one new test.

llvm-svn: 373743
2019-10-04 12:55:13 +00:00
David Bolvansky b4ee523ffc [Diagnostics] Bitwise negation of a boolean expr always evaluates to true; warn with -Wbool-operation
Requested here:
http://lists.llvm.org/pipermail/cfe-dev/2019-October/063452.html

llvm-svn: 373614
2019-10-03 15:17:59 +00:00