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

            Bug ID: 100707
           Summary: [modules] ICE on nested namespace
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: amorvincitomnia.iw at gmail dot com
  Target Milestone: ---

See it live: https://wandbox.org/permlink/HOMZ2A8ClOzIKXO1

Minimum code to reproduce ICE:

// m3.cc
export module m3;
export namespace A{
}

// m2.cc
export module m2;
import m3;
export namespace A::B{
}

// m1.cc
export module m1;
import m2;
export namespace A::B{
}


Compile it with: 
$ g++ "-std=gnu++20" "-fmodules-ts" "m3.cc" "m2.cc" "m1.cc"

Produces the following ICE:

m1.cc:3:21: internal compiler error: in resume_scope, at cp/name-lookup.c:4417
    3 | export namespace A::B{
      |                     ^
0x5f4ed6 resume_scope
        ../../source/gcc/cp/name-lookup.c:4417
0x7328fb push_namespace(tree_node*, bool)
        ../../source/gcc/cp/name-lookup.c:8882
0x779b37 cp_parser_namespace_definition
        ../../source/gcc/cp/parser.c:20475
0x77a458 cp_parser_declaration
        ../../source/gcc/cp/parser.c:14141
0x77a153 cp_parser_module_export
        ../../source/gcc/cp/parser.c:13951
0x77a153 cp_parser_declaration
        ../../source/gcc/cp/parser.c:14104
0x77ac4e cp_parser_toplevel_declaration
        ../../source/gcc/cp/parser.c:14190
0x77ac4e cp_parser_translation_unit
        ../../source/gcc/cp/parser.c:4942
0x77ac4e c_parse_file()
        ../../source/gcc/cp/parser.c:45393
0x84b7dd c_common_parse_file()
        ../../source/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.
  • [Bug c++/100707] New: [mo... amorvincitomnia.iw at gmail dot com via Gcc-bugs

Reply via email to