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

            Bug ID: 84493
           Summary: [8 Regression] ICE with invalid cast
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers an ICE on trunk:

=============================
void foo()
{
  (struct {}x){};
}
=============================

bug.cc: In function 'void foo()':
bug.cc:3:13: error: expected ')' before 'x'
   (struct {}x){};
   ~         ^
             )
bug.cc:3:13: internal compiler error: in consume_open, at cp/parser.c:4711
0x6250d2 token_pair<matching_brace_traits>::consume_open(cp_parser*)
        ../../gcc/gcc/cp/parser.c:4711
0x626972 token_pair<matching_brace_traits>::consume_open(cp_parser*)
        ../../gcc/gcc/tree.h:3246
0x626972 cp_parser_braced_list
        ../../gcc/gcc/cp/parser.c:21928
0x930d90 cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:6989
0x931010 cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:8318
0x91139f cp_parser_cast_expression
        ../../gcc/gcc/cp/parser.c:9086
0x911baa cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:9187
0x9133e4 cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:9482
0x913af8 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:9651
0x9157b8 cp_parser_expression_statement
        ../../gcc/gcc/cp/parser.c:11118
0x91bb2d cp_parser_statement
        ../../gcc/gcc/cp/parser.c:10922
0x91d040 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:11261
0x91d117 cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:11215
0x933890 cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:21756
0x933890 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:21793
0x934140 cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:26694
0x934e74 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:26610
0x934e74 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:19482
0x93bf08 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:13044
0x93cd18 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:12869
Please submit a full bug report, [etc.]

The regression was introduced between 2017-08-10 and 2017-08-19.

Reply via email to