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

            Bug ID: 99040
           Summary: [modules] partitions & 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 ();
}

// t2.ii
export  module  hello:check;

export namespace NS {}

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

export namespace NS
{
using NS::Format;
}

// t4.ii
module  hello;

./cc1plus -quiet -std=c++17 -fmodules-ts -fpreprocessed t1.ii && ./cc1plus
-quiet -std=c++17 -fmodules-ts -fpreprocessed t2.ii && ./cc1plus -quiet
-std=c++17 -fmodules-ts -fpreprocessed t3.ii && ./cc1plus -quiet -std=c++17
-fmodules-ts -fpreprocessed t4.ii -fno-module-lazy
t4.ii:1:14: internal compiler error: in add_module_decl, at
cp/name-lookup.c:4199
    1 | module  hello;
      |              ^
0xd3c3ae add_module_decl(tree_node*, tree_node*, tree_node*)
        ../../../src/gcc/cp/name-lookup.c:4199
0xd0a848 module_state::read_cluster(unsigned int)
        ../../../src/gcc/cp/module.cc:14908
0xd13cf8 module_state::load_section(unsigned int, binding_slot*)
        ../../../src/gcc/cp/module.cc:18068
0xd13a26 module_state::read_language(bool)
        ../../../src/gcc/cp/module.cc:17997
0xd16625 direct_import
        ../../../src/gcc/cp/module.cc:18870
0xd16a79 declare_module(module_state*, unsigned int, bool, tree_node*,
cpp_reader*)
        ../../../src/gcc/cp/module.cc:18975
0xd72cf2 cp_parser_module_declaration
        ../../../src/gcc/cp/parser.c:13757
0xd5f315 cp_parser_translation_unit
        ../../../src/gcc/cp/parser.c:4894
0xdc21a4 c_parse_file()
        ../../../src/gcc/cp/parser.c:45179
0xfa7278 c_common_parse_file()
        ../../../src/gcc/c-family/c-opts.c:1218
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.

Reply via email to