https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120125
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Nathaniel Shead <nsh...@gcc.gnu.org>: https://gcc.gnu.org/g:6b1a99c3e2cf0fb858ad42b19c6834f7593f091d commit r14-11775-g6b1a99c3e2cf0fb858ad42b19c6834f7593f091d Author: Nathaniel Shead <nathanielosh...@gmail.com> Date: Thu May 8 23:06:13 2025 +1000 c++/modules: Fix handling of -fdeclone-ctor-dtor with explicit instantiations [PR120125] The attached testcase ICEs in maybe_thunk_body because we haven't created a node in the cgraph for an imported explicit instantiation yet. We in fact really shouldn't be emitting calls at all, since an imported explicit instantiation always exists in the TU we imported it from. But the required logic for that doesn't exist in this branch, so we'll just xfail the relevant check. PR c++/120125 gcc/cp/ChangeLog: * optimize.cc (maybe_thunk_body): Don't assume 'fn' has a cgraph node created. gcc/testsuite/ChangeLog: * g++.dg/modules/clone-4_a.C: New test. * g++.dg/modules/clone-4_b.C: New test. Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com> Reviewed-by: Jason Merrill <ja...@redhat.com>