https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122915
Nathaniel Shead <nshead at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |16.0
Status|WAITING |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |nshead at gcc dot
gnu.org
--- Comment #3 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Confirmed. Further minimised:
// a.cpp
export module imagine;
namespace ns {}
export namespace ig {
using namespace ns;
}
// b.cpp
export module tests;
import imagine;
using namespace ig;
$ g++ -fmodules -S [ab].cpp
b.cpp:1:8: internal compiler error: in operator(), at cp/module.cc:17640
1 | export module tests;
| ^~~~~~
0x3e8ada8 internal_error(char const*, ...)
../../gcc/gcc/diagnostic-global-context.cc:787
0x3e9aaba fancy_abort(char const*, int, char const*)
../../gcc/gcc/diagnostics/context.cc:1805
0x120e27d operator()
../../gcc/gcc/cp/module.cc:17640
0x120e455 module_state::write_using_directives(elf_out*, depset::hash&,
vec<depset*, va_heap, vl_ptr>, unsigned int*)
../../gcc/gcc/cp/module.cc:17653
0x12180ab module_state::write_begin(elf_out*, cpp_reader*,
module_state_config&, unsigned int&)
../../gcc/gcc/cp/module.cc:20776
0x1220641 finish_module_processing(cpp_reader*)
../../gcc/gcc/cp/module.cc:23293
0x112b02f c_parse_final_cleanups()
../../gcc/gcc/cp/decl2.cc:5827
0x1557fa9 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.cc:1440
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.
The issue is that because 'ig' is an imported namespace, we don't bother
walking it for deps and so never build a dep for 'ns' to bind a using-directive
to. I imagine that we can probably just skip binding the (imported)
using-directive here to fix the ICE.