c++: fix in-charge parm in constexpr
commite0659b5417b7f8a090ad2ed4dea830f11ef9c877
authorJason Merrill <jason@redhat.com>
Wed, 13 Dec 2023 00:20:27 +0000 (12 19:20 -0500)
committerJason Merrill <jason@redhat.com>
Wed, 13 Dec 2023 16:25:19 +0000 (13 11:25 -0500)
tree38a497e8c000e47edf6f31e0504b61021e0adae6
parent958940eb3511e341e57606f5a2f5399bc89533cb
c++: fix in-charge parm in constexpr

I was puzzled by the proposed patch for PR71093 specifically ignoring the
in-charge parameter; the problem turned out to be that when
cxx_eval_call_expression jumps from the clone to the cloned function, it
assumes that the latter has the same parameters, and so the in-charge parm
doesn't get an argument.  Since a class with vbases can't have constexpr
'tors there isn't actually a need for an in-charge parameter in a
destructor, but we used to use it for deleting destructors and never removed
it.  I have a patch to do that for GCC 15, but for now let's work around it.

gcc/cp/ChangeLog:

* constexpr.cc (cxx_eval_call_expression): Handle missing in-charge
argument.
gcc/cp/constexpr.cc