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

--- Comment #3 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:da9cb50722ba0341bab9d0bf29d1cfa12be18f42

commit r17-2831-gda9cb50722ba0341bab9d0bf29d1cfa12be18f42
Author: Jason Merrill <[email protected]>
Date:   Wed Jul 29 14:04:24 2026 -0400

    c++: anonymous namespace in module partition [PR126209]

    Here since r16-4484 we include all namespaces in the current purview in a
    module, even if the namespace comes from another partition.  That breaks
for
    an anonymous namespace, which is local to the TU (and added to the
    definition of TU-local entity by P2996 Reflection); here _c ended up
    representing the anonymous namespace from _a separately from the same one
    passed along from _b, leading to an ICE trying to import them into the same
    slot in _d.  I tried just adding namespaces to is_tu_local_entity, but that
    broke other things, so for 16.2 let's handle them here.

            PR c++/126209

    gcc/cp/ChangeLog:

            * module.cc (depset::hash::add_namespace_entities): Don't
            force out anonymous namespaces.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/anon-5_a.C: New test.
            * g++.dg/modules/anon-5_b.C: New test.
            * g++.dg/modules/anon-5_c.C: New test.
            * g++.dg/modules/anon-5_d.C: New test.

Reply via email to