https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125768

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <[email protected]>:

https://gcc.gnu.org/g:63461fcfcf52092525ed2aad14181c179d68899a

commit r17-1790-g63461fcfcf52092525ed2aad14181c179d68899a
Author: Jason Merrill <[email protected]>
Date:   Tue Jun 23 12:53:02 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.

Reply via email to