https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77796
--- Comment #4 from Eric Gallager <egallager at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #3) > (In reply to Eric Gallager from comment #2) > > (In reply to Eric Gallager from comment #1) > > > 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 > > > ~~~~~~~~~~~^~~~ > > > $ > > > > Diagnostics maintainers, do you know what's up with that? > > That was PR 87386, fixed on trunk. Ah, so it is; output is now: $ /usr/local/bin/g++ -c -Wall -Wextra -pedantic 77796.cc 77796.cc:11:12: warning: self-comparison always evaluates to true [-Wtautological-compare] 11 | B::destroy == A::destroy ? 0 : 1 | ~~~~~~~~~~ ^~ ~~~~~~~~~~ $