[Bug c++/123622] [modules] error on printing missing dependencies when importing not existing header-unit

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Mar 7 22:39:41 GMT 2026


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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

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

commit r16-7948-gfcb78dea6b1b854b80ab623d81402bd0d0c39697
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Mar 5 17:54:30 2026 -0500

    c++/modules: fix -MG for header units [PR123622]

    With -MG we should allow a nonexistent header unit, as we do with a
    nonexistent #include.  But still import it if available.

            PR c++/123622

    gcc/cp/ChangeLog:

            * module.cc (preprocess_module): Check deps.missing_files.

    gcc/testsuite/ChangeLog:

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

    Co-authored-by: <mtxn@duck.com>


More information about the Gcc-bugs mailing list