https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101126
Bug ID: 101126 Summary: Enabling modules suppresses creation of precompiled headers Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: overlord624 at gmail dot com Target Milestone: --- The output of a precompiled header is suppressed if modules are enabled via -fmodules-ts. This can be reproduced with the following invocation using any valid input: g++-11 -x c++-header -std=c++20 -fmodules-ts -o header.hpp.gch header.hpp As described in the manual, -fmodules-ts implicitly sets -fmodule-header when the input is a header file which results in the creation of a compiled header unit in the module cache and causes the output parameter to be silently ignored as a side effect. ----- $ g++-11 -v Using built-in specs. COLLECT_GCC=g++-11 COLLECT_LTO_WRAPPER=/media/extra/libexec/gcc/x86_64-pc-linux-gnu/11.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /media/extra/sources/gcc/configure --host=x86_64-pc-linux-gnu --prefix=/media/extra --disable-multilib --enable-threads --enable-tls --enable-languages=c,c++ --disable-nls Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.0.1 20210402 (experimental) (GCC)