PR c++/70462 - unnecessary base ctor variant with final.
authorJason Merrill <jason@redhat.com>
Wed, 26 Jun 2019 04:56:07 +0000 (00:56 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 26 Jun 2019 04:56:07 +0000 (00:56 -0400)
commit09039e9c723456cd008c7fa94ea772ee796cda2c
tree60c1334be02c0350836747c878fe057d5b20881e
parente21b52afe92f2596a5b0963d6efb5be44ab3b227
PR c++/70462 - unnecessary base ctor variant with final.

As pointed out in the PR, we don't need base 'tor variants for a final
class, since it can never be a base.  I tried also dropping complete
variants for abstract classes, but that runs into ABI compatibility problems
with older releases that refer to those symbols.

* optimize.c (populate_clone_array): Skip base variant if
CLASSTYPE_FINAL.
(maybe_clone_body): We don't need an alias if we are only defining
one clone.

From-SVN: r272669
gcc/cp/ChangeLog
gcc/cp/optimize.c
gcc/testsuite/g++.dg/other/final8.C [new file with mode: 0644]