Give the 'self/array-comparison is always true/false' warning a new flag,

"-Wtautological-compare".

llvm-svn: 108546
This commit is contained in:
Nick Lewycky 2010-07-16 18:42:10 +00:00
parent da3e05db70
commit 725b4e7533
1 changed files with 2 additions and 1 deletions

View File

@ -3003,7 +3003,8 @@ def err_ret_local_block : Error<
// should result in a warning, since these always evaluate to a constant.
// Array comparisons have similar warnings
def warn_comparison_always : Warning<
"%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">;
"%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">,
InGroup<DiagGroup<"tautological-compare">>;
def warn_stringcompare : Warning<
"result of comparison against %select{a string literal|@encode}0 is "