]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Clear uninstantiated template friend when instantiating [PR104234]
authorNathaniel Shead <nathanieloshead@gmail.com>
Thu, 23 Nov 2023 12:15:19 +0000 (23:15 +1100)
committerNathaniel Shead <nathanieloshead@gmail.com>
Mon, 11 Dec 2023 02:33:52 +0000 (13:33 +1100)
commitab3daffcbf35566d468c3028e48068a481048baf
tree7bc012ce007743883f64b5909512b00ef64022d8
parent2c2df123de432356d28ee7e8a9627dc9e80a399d
c++: Clear uninstantiated template friend when instantiating [PR104234]

Otherwise attempting to get the originating module declaration ICEs
because the DECL_CHAIN of an instantiated friend template is no longer
its context.

PR c++/104234
PR c++/112580

gcc/cp/ChangeLog:

* pt.cc (tsubst_template_decl): Clear
DECL_UNINSTANTIATED_TEMPLATE_FRIEND_P.

gcc/testsuite/ChangeLog:

* g++.dg/modules/pr104234.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/pt.cc
gcc/testsuite/g++.dg/modules/pr104234.C [new file with mode: 0644]