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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2026-01-31
     Ever confirmed|0                           |1
                 CC|                            |nshead at gcc dot gnu.org

--- Comment #1 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Confirmed; thanks for the report, and the suggested patch!  Note that patches
should be sent to '[email protected]'.  I will not be able to approve
this myself, and patches just on the bugzilla may be missed.  (There also
appears to be some formatting issues; the testcase should also ideally also
check that the dependency output is actually reasonable; refer to e.g.
gcc/testsuite/g++.dg/modules/dep-2.C for some examples of how you might do
this.)

I wonder if in general we want to also change the '-M' handling of module
imports when the CMIs are not available.  In particular, because header modules
can affect the preprocessor state of the rest of the file, maybe rather than
just ignoring the missing import and continuing on as normal we should be
falling back to treating the 'import' as an '#include' and reporting it like
that, so build systems can infer more accurately what header units we depend
upon.  But that's a more complex question, and I think the improvement to '-MG'
here is a net positive either way.

Reply via email to