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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |16.0
           Assignee|unassigned at gcc dot gnu.org      |nshead at gcc dot 
gnu.org
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
I mistakenly gave the wrong PR number in the fix; this was fixed for GCC16 by

https://gcc.gnu.org/g:c6dd51c062667fdf2db3bed0ab50e034e048f3b5

commit r16-7393-gc6dd51c062667fdf2db3bed0ab50e034e048f3b5
Author: Nathaniel Shead <[email protected]>
Date:   Sat Jan 31 21:45:39 2026 +1100

    c++/modules: Fix ICE with multiple module declarations and -M [PR123738]

    When only doing preprocessing, we do not call declare_module, and so we
    do not check that a module has been declared multiple times.  This means
    we end up with multiple "primary modules" being passed to the dependency
    producing logic, which asserts.  Fixed by checking if we've already seen
    a module declaration and complaining.

            PR c++/123738

    gcc/cp/ChangeLog:

            * module.cc (preprocess_module): Complain for any non-imported
            module declaration in a module purview.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/dep-5.C: New test.

Reply via email to