https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115007
Bug ID: 115007 Summary: [modules] ICE in maybe_clone_body when calling virtual destructor from instantiated template Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nshead at gcc dot gnu.org Blocks: 103524 Target Milestone: --- The following sample ICEs on trunk: // a.cpp module; struct S { virtual ~S() = default; virtual void f() = 0; }; module M:a; S *p; template <typename T> void format(T) { p->~S(); } template void format(int); // m.cpp export module M; import :a; 'g++ -fmodules-ts -Wno-global-module -S a.cpp m.cpp' results in: m.cpp: In destructor ‘S@M:a::~S()’: m.cpp:2:11: internal compiler error: Segmentation fault 2 | import :a; | ^ 0x1bad37f crash_signal ../../gcc/gcc/toplev.cc:319 0x7ffb375cc51f ??? ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 0x1076395 maybe_clone_body(tree_node*) ../../gcc/gcc/cp/optimize.cc:705 0x11e00d9 expand_or_defer_fn_1(tree_node*) ../../gcc/gcc/cp/semantics.cc:5098 0x11e040b expand_or_defer_fn(tree_node*) ../../gcc/gcc/cp/semantics.cc:5133 0xf54666 c_parse_final_cleanups() ../../gcc/gcc/cp/decl2.cc:5362 0x1322ee7 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.cc:1329 Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103524 [Bug 103524] [meta-bug] modules issue