This patch is a proposal to add a new group of warnings under -Wbool-compare.  The separate warnings are:<div><br></div><div><div>-Wbool-compare-logical-not</div><div>Comparisons of the form !x > y which usually means !(x < y) put is parsed as (!x) < y.  Only checks if x is not boolean.  Suggests fixit.</div>

<div>High true positive rate.</div><div><br></div><div>-Wbool-compare-float</div><div>Comparison of float and bool.</div><div>High true positive rate.</div><div><br></div><div><div>-Wbool-compare-tautological</div><div>
Comparisons involving a boolean and an expression evaluating to 1, 0, true, or false such that the comparison always evaluate to true or false.</div><div>Also added to -Wtautological-compare group</div><div>High true positive rate.</div>
<div>Not previously caught by -Wtautological-compare</div><div><br>
</div><div>-Wbool-compare-tautological-out-of-range</div></div><div>Comparisons of a boolean and >1 or negative values.</div><div>Also added to -Wtautological-constant-out-of-range-compare group</div><div>High true positive rate.</div>
<div>Previously, only compares with values >1 were caught.</div>
<div>(x == 5)  currently caught</div><div>(x == -1)  not currently caught</div><div><br></div><div>-Wbool-compare-enum</div><div>Comparison of enum and bool.</div><div>Slightly lower true positive rates than the warnings above, but still over 90%.</div>
<div><br></div><div>-Wbool-compare-redundant</div>
<div>Comparisons where one of the operands and the operator could be dropped.</div><div>Includes fixit.</div><div>Default ignore.</div><div>More of a suggestion.</div><div>(x > 0)  ==>  (x)</div><div>(1 >= x) ==> (x)</div>
<div><br></div><div>-Wbool-compare-equivalent</div>
<div>Comparisons where the comparison is equivalent to negating one of the operands.</div></div><div><div>Includes fixit.</div><div>Default ignore.</div></div><div>More of a suggestion.</div><div>(x != 1)  ==>  (!(x))</div>

<div>(0 == x)  ==>  (!(x))</div>