https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99051
Bug ID: 99051 Summary: [modules] ICE/SIGSEGV in get_location_from_adhoc_loc Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: boris at kolpackov dot net Target Milestone: --- cat <<EOF >hello.hxx #pragma once #if 1 import <string_view>; #else #include <string_view> #endif void say_hello (const std::string_view& name); EOF g++ -std=c++2a -fmodules-ts -fmodule-header -x c++-header /path/to/include/c++/11.0.0/string_view g++ -std=c++2a -fmodules-ts -fmodule-header -x c++-header hello.hxx hello.hxx: internal compiler error: Segmentation fault 0x1809473 crash_signal ../../gcc/gcc/toplev.c:327 0x2c2808b get_location_from_adhoc_loc(line_maps const*, unsigned int) ../../gcc/libcpp/line-map.c:257 0xc634c8 module_state::write_location(bytes_out&, unsigned int) ../../gcc/gcc/cp/module.cc:15600 0xc65c6f module_state::write_define(bytes_out&, cpp_macro const*, bool) ../../gcc/gcc/cp/module.cc:16368 0xc66f09 module_state::write_macros(elf_out*, cpp_reader*, unsigned int*) ../../gcc/gcc/cp/module.cc:16870 0xc69d65 module_state::write(elf_out*, cpp_reader*) ../../gcc/gcc/cp/module.cc:17747 0xc6ffe9 finish_module_processing(cpp_reader*) ../../gcc/gcc/cp/module.cc:19778 0xb8e905 c_parse_final_cleanups() ../../gcc/gcc/cp/decl2.c:5178 0xf10f4c c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1240