]> git.ipfire.org Git - thirdparty/gcc.git/commit
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>
Tue, 18 Apr 2023 20:44:27 +0000 (16:44 -0400)
commitdbd8af5d8f4568ed5683ae8aa15ccb330bbf74c0
treeec3d8a6b2ad7f6a1ff67084209ad5cc5c477be21
parent890d711a2477119a34cf435f6159b6253b124374
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]