c++: Fix base copy elision thinko [PR98744]
authorJason Merrill <jason@redhat.com>
Fri, 22 Jan 2021 16:57:27 +0000 (11:57 -0500)
committerJason Merrill <jason@redhat.com>
Fri, 22 Jan 2021 18:09:00 +0000 (13:09 -0500)
commit90cbc769006a43ed17d2384b3a0a4634f315d3fd
tree3d06f73f4cdba6e1ca5fdbdeeb8546808d609262
parenta9ed18295bfc6d69d40af197e059e16622cd94c6
c++: Fix base copy elision thinko [PR98744]

As Jakub points out in the PR, I was mixing up
DECL_HAS_IN_CHARGE_PARM_P (which is true for the abstract maybe-in-charge
constructor) and DECL_HAS_VTT_PARM_P (which is true for a base constructor
that needs to handle virtual bases).

gcc/cp/ChangeLog:

PR c++/98744
* call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.

gcc/testsuite/ChangeLog:

PR c++/98744
* g++.dg/init/elide7.C: New test.
gcc/cp/call.c
gcc/testsuite/g++.dg/init/elide7.C [new file with mode: 0644]