https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84429
Bug ID: 84429
Summary: [8 Regression] ICE capturing variable-sized array
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Keywords: ice-on-valid-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 valid code snippet triggers an ICE on trunk:
=====================================
void foo(int i)
{
char x[i];
[&]{ [&]{ return x; }; };
}
=====================================
bug.cc: In lambda function:
bug.cc:4:20: internal compiler error: in build_capture_proxy, at
cp/lambda.c:459
[&]{ [&]{ return x; }; };
^
0x8d5615 build_capture_proxy(tree_node*, tree_node*)
../../gcc/gcc/cp/lambda.c:459
0x8d5926 add_capture(tree_node*, tree_node*, tree_node*, bool, bool)
../../gcc/gcc/cp/lambda.c:660
0x8d5ece add_default_capture(tree_node*, tree_node*, tree_node*)
../../gcc/gcc/cp/lambda.c:710
0x9abfe8 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*,
bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int)
../../gcc/gcc/cp/semantics.c:3541
0x91dd9c cp_parser_primary_expression
../../gcc/gcc/cp/parser.c:5607
0x9301bc cp_parser_postfix_expression
../../gcc/gcc/cp/parser.c:7026
0x930d90 cp_parser_unary_expression
../../gcc/gcc/cp/parser.c:8318
0x91117f cp_parser_cast_expression
../../gcc/gcc/cp/parser.c:9086
0x91198a cp_parser_binary_expression
../../gcc/gcc/cp/parser.c:9187
0x913164 cp_parser_assignment_expression
../../gcc/gcc/cp/parser.c:9476
0x913878 cp_parser_expression
../../gcc/gcc/cp/parser.c:9645
0x91c01b cp_parser_jump_statement
../../gcc/gcc/cp/parser.c:12396
0x91c01b cp_parser_statement
../../gcc/gcc/cp/parser.c:10810
0x91cdc0 cp_parser_statement_seq_opt
../../gcc/gcc/cp/parser.c:11255
0x91d897 cp_parser_lambda_body
../../gcc/gcc/cp/parser.c:10669
0x91d897 cp_parser_lambda_expression
../../gcc/gcc/cp/parser.c:10176
0x91d897 cp_parser_primary_expression
../../gcc/gcc/cp/parser.c:5257
0x9301bc cp_parser_postfix_expression
../../gcc/gcc/cp/parser.c:7026
0x930d90 cp_parser_unary_expression
../../gcc/gcc/cp/parser.c:8318
0x91117f cp_parser_cast_expression
../../gcc/gcc/cp/parser.c:9086
Please submit a full bug report, [etc.]
The regression was introduced between 2017-09-26 and 2017-10-07.