PR c++/86586 - -fcompare-debug=-Wsign-compare.
authorJason Merrill <jason@redhat.com>
Wed, 3 Apr 2019 20:12:00 +0000 (16:12 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 3 Apr 2019 20:12:00 +0000 (16:12 -0400)
commit7a506c3c63873916f318b6152367f81de1b3f57f
tree06de43d6d304f06c9707c4b3abdd09cab3225c08
parentb8836dbec1a36eb3a00c789a4ed1e64ba28ee6fe
PR c++/86586 - -fcompare-debug=-Wsign-compare.

This patch limits constexpr folding for -Wsign-compare to only cases that we
would warn for without considering constant values, avoiding the folding in
the testcase in question.

gcc/c-family/
* c-warn.c (warn_for_sign_compare): Call fold_for_warn.
gcc/cp/
* typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare.

From-SVN: r270136
gcc/c-family/ChangeLog
gcc/c-family/c-warn.c
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/g++.target/i386/mv1.C