https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122053
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Reduced to: $ cat std.cc module; struct mytime { long a, b; }; namespace N { struct A { void foo (mytime); }; struct B { A a; }; } export module NN; export namespace N { using N::B; } $ cat inet.cc import NN; struct mytime { long a, b; }; $ rm -rf gcm.cache; ~/src/gcc/obj44i/usr/local/bin/g++ -fmodules -O2 -std=c++26 std.cc -S; ~/src/gcc/obj44i/usr/local/bin/g++ -fmodules -O2 -std=c++26 /home/jakub/src/gcc/obj44i/zz/inet.cc -S std.cc:2:1: warning: global module fragment contents must be from preprocessor inclusion [-Wglobal-module] 2 | struct mytime { long a, b; }; | ^~~~~~ /home/jakub/src/gcc/obj44i/zz/inet.cc:5:9: internal compiler error: in finish_member_declaration, at cp/semantics.cc:4250 5 | long a, b; | ^ 0x318f98f internal_error(char const*, ...) ../../gcc/diagnostic-global-context.cc:786 0xfbb337 fancy_abort(char const*, int, char const*) ../../gcc/diagnostics/context.cc:1803 0x896750 finish_member_declaration(tree_node*) ../../gcc/cp/semantics.cc:4250 0x11ee027 cp_parser_member_declaration ../../gcc/cp/parser.cc:30075 0x11b5a73 cp_parser_member_specification_opt ../../gcc/cp/parser.cc:29328 0x11b5a73 cp_parser_class_specifier ../../gcc/cp/parser.cc:28208 0x11b72ab cp_parser_type_specifier ../../gcc/cp/parser.cc:21255 0x11b7617 cp_parser_decl_specifier_seq ../../gcc/cp/parser.cc:17843 0x11eb45d cp_parser_simple_declaration ../../gcc/cp/parser.cc:16937 0x11f8f26 cp_parser_declaration ../../gcc/cp/parser.cc:16684 0x11fa46b cp_parser_toplevel_declaration ../../gcc/cp/parser.cc:16705 0x11fa46b cp_parser_translation_unit ../../gcc/cp/parser.cc:5505 0x11fa46b c_parse_file() ../../gcc/cp/parser.cc:55146 0x1372981 c_common_parse_file() ../../gcc/c-family/c-opts.cc:1418 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.