c++: -Woverloaded-virtual and dtors [PR87729]
commit81bec060e31b6ef2feeb3046c6f13a207c6f698a
authorJason Merrill <jason@redhat.com>
Thu, 7 Jul 2022 14:12:04 +0000 (7 10:12 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 7 Jul 2022 15:56:09 +0000 (7 11:56 -0400)
treeb4ba8d61bf92cb0c9d49d5d3409b37722a97e9df
parentd89fa97ff318b1f892e2629c5a249313872a01b1
c++: -Woverloaded-virtual and dtors [PR87729]

My earlier patch broke out of the loop over base members when we found a
match, but that caused trouble for dtors, which can have multiple for which
same_signature_p is true.  But as the function comment says, we know this
doesn't apply to [cd]tors, so skip them.

PR c++/87729

gcc/cp/ChangeLog:

* class.cc (warn_hidden): Ignore [cd]tors.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Woverloaded-virt3.C: New test.
gcc/cp/class.cc
gcc/testsuite/g++.dg/warn/Woverloaded-virt3.C [new file with mode: 0644]