Commit Graph

2 Commits

Author SHA1 Message Date
Richard Trieu 1cd076eb34 Fix -Wlogical-not-parentheses to work better with C code.
Remove the assumption of a Boolean type by checking if an expression is known
to have a boolean value.  Disable warning in two other tests.

llvm-svn: 245507
2015-08-19 21:33:54 +00:00
Richard Trieu 0f09774f17 Extend -Wtautological-constant-out-of-range-compare to handle boolean values
better.  This warning will now trigger on the following conditionals:

bool b;
int i;

if (b > 1) {}  // always false
if (0 <= (i > 5)) {} // always true
if (-1 > b) {} // always false

Patch by Per Viberg.

llvm-svn: 205608
2014-04-04 04:13:47 +00:00