c++: __func__ and local class DMI [PR105809]
authorJason Merrill <jason@redhat.com>
Thu, 16 Mar 2023 19:35:15 +0000 (15:35 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 16 Mar 2023 22:11:23 +0000 (18:11 -0400)
commit78b3bf0e65072f5fa42a8da43698711220d4f8ef
treeecea317882f2a2aabf98beb27838d6e6e6cbc6d2
parentb323f52ccf966800297b0520b9e1d4b3951db525
c++: __func__ and local class DMI [PR105809]

As in 108242, we need to instantiate in the context of the enclosing
function, not after it's gone.

PR c++/105809

gcc/cp/ChangeLog:

* init.cc (get_nsdmi): Split out...
(maybe_instantiate_nsdmi_init): ...this function.
* cp-tree.h: Declare it.
* pt.cc (tsubst_expr): Use it.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/constexpr-__func__3.C: New test.
gcc/cp/cp-tree.h
gcc/cp/init.cc
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp0x/constexpr-__func__3.C [new file with mode: 0644]