This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77796] tautological compare warning emitted for inherited static method comparisons
- From: "egallager at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 25 Aug 2017 14:21:00 +0000
- Subject: [Bug c++/77796] tautological compare warning emitted for inherited static method comparisons
- Auto-submitted: auto-generated
- References: <bug-77796-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77796
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-08-25
CC| |egallager at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> ---
Confirmed. Also, it seems weird that the warning underlines all of B::destroy,
but only the "A" in A::destroy:
$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic 77796.cc
77796.cc:11:12: warning: self-comparison always evaluates to true
[-Wtautological-compare]
B::destroy == A::destroy ? 0 : 1
~~~~~~~~~~~^~~~
$