]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: remove redundant warning [PR100879]
authorJason Merrill <jason@redhat.com>
Tue, 8 Jun 2021 21:48:49 +0000 (17:48 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 21 Jun 2021 20:42:33 +0000 (16:42 -0400)
commit4f2819223873266b4cdfa7af54752a37d1ebd665
treee5f3347d5082e5a1d345235790f869a0391b6940
parent4c4bebb834ec19d68ef7248510cfe2548d864454
c++: remove redundant warning [PR100879]

Before my r277864, build_new_op promoted enums to int before passing them on
to cp_build_binary_op; after that commit, it doesn't, so
warn_for_sign_compare sees the enum operands and gives a redundant warning.
This warning dates back to 1995, and seems to have been dead code for a long
time--likely since build_new_op was added in 1997--so let's just remove it.

PR c++/100879

gcc/c-family/ChangeLog:

* c-warn.c (warn_for_sign_compare): Remove C++ enum mismatch
warning.

gcc/testsuite/ChangeLog:

* g++.dg/diagnostic/enum3.C: New test.
gcc/c-family/c-warn.c
gcc/testsuite/g++.dg/diagnostic/enum3.C [new file with mode: 0644]