https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105809
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:dbd8af5d8f4568ed5683ae8aa15ccb330bbf74c0 commit r12-9438-gdbd8af5d8f4568ed5683ae8aa15ccb330bbf74c0 Author: Jason Merrill <ja...@redhat.com> Date: Thu Mar 16 15:35:15 2023 -0400 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.