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.