https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109718
Bug ID: 109718
Summary: Dependency generation for header-units and modules not
possible
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: klaus.doldinger64 at googlemail dot com
Target Milestone: ---
To generate make-dependencies I use the following command line:
g++ -c -MD -MG -std=c++23 -fconcepts -fmodules-ts test.cc
where test.cc is:
-----------------
import <array>;
int main() {
}
-----------------
It gives the error:
cc1plus: error: '-MG' may only be used with '-M' or '-MM'
Removing -MG gives also an error, because the precompiled header does not yet
exist:
/usr/local/include/c++/14.0.0/iostream: error: failed to read compiled module:
No such file or directory
/usr/local/include/c++/14.0.0/iostream: note: compiled module file is
'gcm.cache/./usr/local/include/c++/14.0.0/iostream.gcm'
/usr/local/include/c++/14.0.0/iostream: note: imports must be built before
being imported
/usr/local/include/c++/14.0.0/iostream: fatal error: returning to the gate for
a mechanical issue
So, it looks that there is no possiblity to create a valid dependency file with
gcc.