https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99879
--- Comment #2 from Alexander Lelyakin <alexander.lelyakin at googlemail dot com> --- The last sequence sometimes gives ICE in open, and sometimes in install entity: /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header memory /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header cstdio /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header span /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header shared_mutex /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header cstdint /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header clocale /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header bitset /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header semaphore /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header exception /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header numbers /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header charconv /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header locale /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header string /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header ranges /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header cstring /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header regex ---- In module imported at /usr/local/include/c++/11.0.1/regex:45:1: /usr/local/include/c++/11.0.1/memory: note: unable to represent further imported source locations In file included from /usr/local/include/c++/11.0.1/sstream:38, from /usr/local/include/c++/11.0.1/regex:46: /usr/local/include/c++/11.0.1/istream:58:42: internal compiler error: in install_entity, at cp/module.cc:7468 58 | class basic_istream : virtual public basic_ios<_CharT, _Traits> | ^~~~~~~~~ 0xa700a8 trees_in::install_entity(tree_node*) ../../gcc/gcc/cp/module.cc:7468 0xa785c6 trees_in::decl_value() ../../gcc/gcc/cp/module.cc:7980 0xa70f87 trees_in::tree_node(bool) ../../gcc/gcc/cp/module.cc:9153 0xa775ab module_state::read_cluster(unsigned int) ../../gcc/gcc/cp/module.cc:14811 0xa77aad module_state::load_section(unsigned int, binding_slot*) ../../gcc/gcc/cp/module.cc:18082 0xa77b6f module_state::lazy_load(unsigned int, binding_slot*) ../../gcc/gcc/cp/module.cc:18740 0xa71df0 trees_in::tree_node(bool) ../../gcc/gcc/cp/module.cc:9664 0xa772ab module_state::read_cluster(unsigned int) ../../gcc/gcc/cp/module.cc:14717 0xa77aad module_state::load_section(unsigned int, binding_slot*) ../../gcc/gcc/cp/module.cc:18082 0xa77b6f module_state::lazy_load(unsigned int, binding_slot*) ../../gcc/gcc/cp/module.cc:18740 0xa71df0 trees_in::tree_node(bool) ../../gcc/gcc/cp/module.cc:9664 0xa772ab module_state::read_cluster(unsigned int) ../../gcc/gcc/cp/module.cc:14717 0xa77aad module_state::load_section(unsigned int, binding_slot*) ../../gcc/gcc/cp/module.cc:18082 0xa77c68 lazy_load_binding(unsigned int, tree_node*, tree_node*, binding_slot*) ../../gcc/gcc/cp/module.cc:18773 0xa8988e name_lookup::search_namespace_only(tree_node*) ../../gcc/gcc/cp/name-lookup.c:928 0xa8aedb name_lookup::search_unqualified(tree_node*, cp_binding_level*) ../../gcc/gcc/cp/name-lookup.c:1158 0xa8dbe4 lookup_name_1 ../../gcc/gcc/cp/name-lookup.c:7804 0xa8ddca lookup_name(tree_node*, LOOK_where, LOOK_want) ../../gcc/gcc/cp/name-lookup.c:7824 0xa9caa2 lookup_name(tree_node*, LOOK_want) ../../gcc/gcc/cp/name-lookup.h:401 0xa9caa2 cp_parser_lookup_name ../../gcc/gcc/cp/parser.c:29386 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.