[Bug c++/125768] [16/17 Regression] c++/modules: ICE (segfault build_special_member_call) on member-init of a module-attached class with dense members when 'import std'
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jun 25 16:16:46 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125768
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:
https://gcc.gnu.org/g:bb27e668b3fd3efb407c33b9bfc3548ee5c8493b
commit r16-9173-gbb27e668b3fd3efb407c33b9bfc3548ee5c8493b
Author: Jason Merrill <jason@redhat.com>
Date: Thu Jun 25 12:16:36 2026 -0400
c++/modules: imported incomplete typedef [PR125768]
Here A<S> is not instantiated in _a, so the exported a_s typedef is to an
incomplete type. It's instantiated in _b, but when marking things
reachable
we get as far as the imported typedef and stop, so we don't write out the
instantiation. Then in _c we read in the definition of Outer with an
incomplete type for 'sub', and ICE when trying to initialize it in the
constructor.
Fixed by looking into the DECL_ORIGINAL_TYPE of an imported typedef when
gathering dependencies.
PR c++/125768
gcc/cp/ChangeLog:
* module.cc (trees_out::decl_node): When not streaming,
recurse into DECL_ORIGINAL_TYPE of an imported typedef.
gcc/testsuite/ChangeLog:
* g++.dg/modules/alias-3_a.C: New test.
* g++.dg/modules/alias-3_b.C: New test.
* g++.dg/modules/alias-3_c.C: New test.
(cherry picked from commit 63461fcfcf52092525ed2aad14181c179d68899a)
More information about the Gcc-bugs
mailing list