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

            Bug ID: 121442
           Summary: [16 Regression] Error recovery ICE since r16-2108
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

struct S { int a, b, c, d, e; };

void
foo ()
{
  auto [a, b, b, b, c ] = S {};
}

ICEs starting with r16-2108-gc81447d969f27a8653ebb1a450372f0d25a2e628
u3.C: In function ‘void foo()’:
u3.C:6:15: error: redeclaration of ‘auto b’
    6 |   auto [a, b, b, b, c ] = S {};
      |               ^
u3.C:6:12: note: ‘auto b’ previously declared here
    6 |   auto [a, b, b, b, c ] = S {};
      |            ^
u3.C:6:18: error: redeclaration of ‘auto b’
    6 |   auto [a, b, b, b, c ] = S {};
      |                  ^
u3.C:6:12: note: ‘auto b’ previously declared here
    6 |   auto [a, b, b, b, c ] = S {};
      |            ^
u3.C:6:23: internal compiler error: tree check: expected var_decl or
function_decl, have error_mark in cp_parser_decomposition_declaration, at
cp/parser.cc:17005
    6 |   auto [a, b, b, b, c ] = S {};
      |                       ^
0x2f7fbe9 internal_error(char const*, ...)
        ../../gcc/diagnostic-global-context.cc:534
0x168b7ca tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/tree.cc:9161
0x448333 tree_check2(tree_node*, char const*, int, char const*, tree_code,
tree_code)
        ../../gcc/tree.h:3752
0x705370 cp_parser_decomposition_declaration
        ../../gcc/cp/parser.cc:17005
0x704468 cp_parser_simple_declaration
        ../../gcc/cp/parser.cc:16617
0x70421f cp_parser_block_declaration
        ../../gcc/cp/parser.cc:16512
0x70208c cp_parser_declaration_statement
        ../../gcc/cp/parser.cc:15549
0x6fc63b cp_parser_statement
        ../../gcc/cp/parser.cc:13379
0x6fdaf0 cp_parser_statement_seq_opt
        ../../gcc/cp/parser.cc:13953
0x6fd660 cp_parser_compound_statement
        ../../gcc/cp/parser.cc:13800
0x719b89 cp_parser_function_body
        ../../gcc/cp/parser.cc:26949
0x719edf cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/cp/parser.cc:27000
0x7293b6 cp_parser_function_definition_after_declarator
        ../../gcc/cp/parser.cc:34006
0x72919c cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/cp/parser.cc:33921
0x71411b cp_parser_init_declarator
        ../../gcc/cp/parser.cc:24231
0x7046b7 cp_parser_simple_declaration
        ../../gcc/cp/parser.cc:16693
0x70421f cp_parser_block_declaration
        ../../gcc/cp/parser.cc:16512
0x703c4f cp_parser_declaration
        ../../gcc/cp/parser.cc:16313
0x703d2c cp_parser_toplevel_declaration
        ../../gcc/cp/parser.cc:16334
0x6e84c9 cp_parser_translation_unit
        ../../gcc/cp/parser.cc:5503
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.

Reply via email to