re PR c++/66555 (Fails to warn for if (j == 0 && i == i))
PR c++/66555
PR c/54979
* c-common.c (find_array_ref_with_const_idx_r): New function.
(warn_tautological_cmp): New function.
* c-common.h (warn_tautological_cmp): Declare.
* c.opt (Wtautological-compare): New option.
* c-typeck.c (parser_build_binary_op): Call warn_tautological_cmp.
* call.c (build_new_op_1): Call warn_tautological_cmp.
* pt.c (tsubst_copy_and_build): Use sentinel to suppress tautological
compare warnings.
* doc/invoke.texi: Document -Wtautological-compare.
* c-c++-common/Wtautological-compare-1.c: New test.
From-SVN: r226242
15 files changed: