[Bug c++/120379] [modules] dependency file generation causes ICE when two export module declarations are provided

2026-02-07 Thread nshead at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120379

Nathaniel Shead  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  ---
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 
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.

[Bug c++/120379] [modules] dependency file generation causes ICE when two export module declarations are provided

2025-05-21 Thread nshead at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120379

Nathaniel Shead  changed:

   What|Removed |Added

 Ever confirmed|0   |1
Summary|[modules]   |[modules] dependency file
   |-fdeps-format=p1689r5   |generation causes ICE when
   |causes ICE when two export  |two export module
   |module declarations are |declarations are provided
   |provided|
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2025-05-21

--- Comment #1 from Nathaniel Shead  ---
Actually, just '-M' is enough.