https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116671
Bug ID: 116671 Summary: Compiling iostream and string as modules fails if string is compiled first Product: gcc Version: 14.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bmlushma at uwaterloo dot ca Target Milestone: --- gcc will not compile iostream as a module if string has already been compiled gcc -v output: Using built-in specs. COLLECT_GCC=/usr/local/bin/g++-14.2.0 COLLECT_LTO_WRAPPER=/usr/local/gcc-14.2.0/libexec/gcc/x86_64-linux-gnu/14.2.0/lto-wrapper Target: x86_64-linux-gnu Configured with: ./configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-14.2.0 --enable-checking=release --enable-languages=c,c++ --disable-multilib --program-suffix=-14.2.0 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.2.0 (GCC) Exact command line: /usr/local/bin/g++-14.2.0 -std=c++20 -fmodules-ts -c -x c++-system-header string /usr/local/bin/g++-14.2.0 -std=c++20 -fmodules-ts -c -x c++-system-header iostream Output: In file included from /usr/local/gcc-14.2.0/include/c++/14.2.0/bits/locale_classes.h:883, from /usr/local/gcc-14.2.0/include/c++/14.2.0/bits/ios_base.h:41, from /usr/local/gcc-14.2.0/include/c++/14.2.0/ios:44, from /usr/local/gcc-14.2.0/include/c++/14.2.0/ostream:40, from /usr/local/gcc-14.2.0/include/c++/14.2.0/iostream:41: /usr/local/gcc-14.2.0/include/c++/14.2.0/bits/locale_classes.tcc: In function ‘const _Facet* std::__try_use_facet(const locale&)’: /usr/local/gcc-14.2.0/include/c++/14.2.0/bits/locale_classes.tcc:108:7: error: template argument 3 is invalid 108 | _GLIBCXX_STD_FACET(codecvt<char, char, mbstate_t>); | ^~~~~~~~~~~~~~~~~~ /usr/local/gcc-14.2.0/include/c++/14.2.0/bits/locale_classes.tcc:108:7: error: expected primary-expression before ‘)’ token 108 | _GLIBCXX_STD_FACET(codecvt<char, char, mbstate_t>); | ^~~~~~~~~~~~~~~~~~ /usr/local/gcc-14.2.0/include/c++/14.2.0/bits/locale_classes.tcc:123:7: error: template argument 3 is invalid 123 | _GLIBCXX_STD_FACET(codecvt<wchar_t, char, mbstate_t>); | ^~~~~~~~~~~~~~~~~~ /usr/local/gcc-14.2.0/include/c++/14.2.0/bits/locale_classes.tcc:123:7: error: expected primary-expression before ‘)’ token 123 | _GLIBCXX_STD_FACET(codecvt<wchar_t, char, mbstate_t>); | ^~~~~~~~~~~~~~~~~~ /usr/local/gcc-14.2.0/include/c++/14.2.0/bits/locale_classes.tcc:135:7: error: template argument 3 is invalid 135 | _GLIBCXX_STD_FACET(codecvt<char16_t, char, mbstate_t>); | ^~~~~~~~~~~~~~~~~~ /usr/local/gcc-14.2.0/include/c++/14.2.0/bits/locale_classes.tcc:135:7: error: expected primary-expression before ‘)’ token 135 | _GLIBCXX_STD_FACET(codecvt<char16_t, char, mbstate_t>); | ^~~~~~~~~~~~~~~~~~ /usr/local/gcc-14.2.0/include/c++/14.2.0/bits/locale_classes.tcc:136:7: error: template argument 3 is invalid 136 | _GLIBCXX_STD_FACET(codecvt<char32_t, char, mbstate_t>); | ^~~~~~~~~~~~~~~~~~ /usr/local/gcc-14.2.0/include/c++/14.2.0/bits/locale_classes.tcc:136:7: error: expected primary-expression before ‘)’ token 136 | _GLIBCXX_STD_FACET(codecvt<char32_t, char, mbstate_t>); | ^~~~~~~~~~~~~~~~~~ In file included from /usr/local/gcc-14.2.0/include/c++/14.2.0/bits/locale_facets.h:39, from /usr/local/gcc-14.2.0/include/c++/14.2.0/bits/basic_ios.h:37, from /usr/local/gcc-14.2.0/include/c++/14.2.0/ios:46: /usr/local/gcc-14.2.0/include/c++/14.2.0/cwctype: At global scope: /usr/local/gcc-14.2.0/include/c++/14.2.0/cwctype:84:11: error: ‘typedef unsigned int wint_t’ conflicts with a previous declaration 84 | using ::wint_t; | ^~~~~~ ‘ /usr/local/gcc-14.2.0/include/c++/14.2.0/cwctype:84: confused by earlier errors, bailing out