c++: Emit as-base 'tor symbols for final class. [PR95428]
authorJason Merrill <jason@redhat.com>
Fri, 21 Aug 2020 20:23:03 +0000 (16:23 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 25 Aug 2020 02:43:39 +0000 (22:43 -0400)
commit6b958ee0fd0e1b2a2b22784ffbe531ed74358a22
tree5a5489ac95c1e2eaa04e9c2ef06dc58a01cbead8
parentb2b24d30bbf7496986fee3a7f201b69ba973d3b0
c++: Emit as-base 'tor symbols for final class.  [PR95428]

For PR70462 I stopped emitting the as-base constructor and destructor
variants for final classes, because they can never be called.  Except that
it turns out that clang calls base variants from complete variants, even for
classes with virtual bases, and in some cases inlines them such that the
calls to the base variant are exposed.  So we need to continue to emit the
as-base symbols, even though they're unreachable by G++-compiled code.

gcc/cp/ChangeLog:

PR c++/95428
* optimize.c (populate_clone_array): Revert PR70462 change.
(maybe_clone_body): Likewise.

gcc/testsuite/ChangeLog:

* g++.dg/other/final8.C: Adjust expected output.
gcc/cp/optimize.c
gcc/testsuite/g++.dg/other/final8.C