https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99039

            Bug ID: 99039
           Summary: cross-module using declarations
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nathan at gcc dot gnu.org
  Target Milestone: ---

triaged from pr98760

// t1.ii
export  module  format;

export namespace NS
{
void Format ();
}

// t3.ii
export  module  hello;
import  format;

export namespace NS
{
using NS::Format;
}

devvm1702:99>./cc1plus -quiet -std=c++17 -fmodules-ts -fpreprocessed t1.ii &&
./cc1plus -quiet -std=c++17 -fmodules-ts -fpreprocessed t3.ii
t3.ii:1:9: internal compiler error: in decl_node, at cp/module.cc:8634
    1 | export  module  hello;
      |         ^~~~~~
0xcee399 trees_out::decl_node(tree_node*, walk_kind)
        ../../../src/gcc/cp/module.cc:8634
0xcf07cb trees_out::tree_node(tree_node*)
        ../../../src/gcc/cp/module.cc:9161
0xd0976d module_state::write_cluster(elf_out*, depset**, unsigned int,
depset::hash&, unsigned int*, unsigned int*)
        ../../../src/gcc/cp/module.cc:14660
0xd12c73 module_state::write(elf_out*, cpp_reader*)
        ../../../src/gcc/cp/module.cc:17707
0xd18d3b finish_module_processing(cpp_reader*)
        ../../../src/gcc/cp/module.cc:19779
0xc3c87e c_parse_final_cleanups()
        ../../../src/gcc/cp/decl2.c:5178
0xfa734d c_common_parse_file()
        ../../../src/gcc/c-family/c-opts.c:1240
Please submit a full bug report,

Reply via email to