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

Nathaniel Shead <nshead at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-checking,
                   |                            |ice-on-valid-code
      Known to fail|                            |15.2.1
      Known to work|15.2.0                      |
            Summary|[16 Regression] Modules     |Modules internal compiler
                   |internal compiler error: in |error: in
                   |expose_existing_namespace,  |expose_existing_namespace,
                   |at cp/name-lookup.cc        |at cp/name-lookup.cc
                 CC|                            |nshead at gcc dot gnu.org

--- Comment #2 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Confirmed the bug for x86_64-pc-linux-gnu.  FWIW this is a checking-only ICE
that's failing; the same assertion fails in 15.2 when compiled with checking
enabled (though with a different backtrace as I've recently refactored this
area), and presumably earlier versions as well (I haven't checked) so I don't
think this is a regression.

The issue is that we're checking if the binding entity for the current TU
matches the namespace we're pushing.  In this case the slot however is a
STAT_HACK we created during 'maybe_record_mergeable_decl' to indicate that the
binding entity contains a global module binding.

Adding '|| (STAT_HACK_P ((tree) slot) && STAT_DECL ((tree) slot) == ns)' should
fix the assertion, but maybe we want to just not build the STAT_HACK for
namespaces, as they'll always be global module regardless, and cannot match
with any other declaration.

Reply via email to