https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98770
Bug ID: 98770 Summary: [modules] including certain stdlib headers in the global module fragment of different modules causes conflicting global module declarations Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: pilarlatiesa at gmail dot com Target Milestone: --- $ /home/pililatiesa/GCC-11/bin/g++ -v Using built-in specs. COLLECT_GCC=/home/pililatiesa/GCC-11/bin/g++ Target: x86_64-pc-linux-gnu Configured with: ../gcc-master/configure --prefix=($HOME)/GCC-11 --enable-languages=c++ --disable-bootstrap Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.0.0 20210115 (experimental) (GCC) $ cat Tensor.ixx module; #include <cstddef> #include <iostream> export module VF.Tensor; namespace VF { export template<std::size_t d, std::size_t r1> struct TTensor { private: std::istream inline &Read(std::istream &is) { return is; } }; export template<std::size_t d> using TVector = TTensor<d, 1u>; } // VF $ cat Mesh.ixx module; #include <cstddef> #include <type_traits> export module VF.Mesh; import VF.Tensor; namespace VF { template <std::size_t d> class TPoint final : public TVector<d> {}; } $ /home/pililatiesa/GCC-11/bin/g++ -fmodules-ts -x c++ -std=c++20 -I../ -I./ Tensor.ixx Mesh.ixx -o foo In file included from /home/pililatiesa/GCC-11/include/c++/11.0.0/bits/move.h:57, from /home/pililatiesa/GCC-11/include/c++/11.0.0/bits/nested_exception.h:40, from /home/pililatiesa/GCC-11/include/c++/11.0.0/exception:148, from /home/pililatiesa/GCC-11/include/c++/11.0.0/ios:39, from /home/pililatiesa/GCC-11/include/c++/11.0.0/ostream:38, from /home/pililatiesa/GCC-11/include/c++/11.0.0/iostream:39, from Tensor.ixx:5, of module VF.Tensor, imported at Mesh.ixx:9: /home/pililatiesa/GCC-11/include/c++/11.0.0/type_traits:634:31: error: conflicting global module declaration ‘template<class ...> using __void_t = void’ 634 | template<typename...> using __void_t = void; | ^~~~~~~~ In file included from Mesh.ixx:5: /home/pililatiesa/GCC-11/include/c++/11.0.0/type_traits:634:31: note: existing declaration ‘template<class ...> using __void_t = void’ 634 | template<typename...> using __void_t = void; | ^~~~~~~~ Mesh.ixx:14:29: note: during load of binding ‘VF::TVector@VF.Tensor’ 14 | class TPoint final : public TVector<d> {}; | ^~~~~~~ Mesh.ixx:7:8: warning: not writing module ‘VF.Mesh’ due to errors 7 | export module VF.Mesh; |