https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90623
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-valid-code Status|UNCONFIRMED |NEW Last reconfirmed| |2019-05-25 CC| |mpolacek at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Ouch, it actually ICEs: $ xg++ -c 90623.C -std=c++17 90623.C: In instantiation of ‘main()::<lambda(auto:4 ...)> [with auto:4 = {int, int, int}]’: 90623.C:15:46: required from here 90623.C:9:21: error: redeclaration of ‘const int xs#1’ 9 | (call_cart(f, xs, xs... ), ...); // ok with gcc8 // error with gcc9 | ^~ 90623.C:9:25: note: ‘const int xs#1’ previously declared here 9 | (call_cart(f, xs, xs... ), ...); // ok with gcc8 // error with gcc9 | ^~ 90623.C:9:25: error: redeclaration of ‘const int xs#0’ 90623.C:9:21: note: ‘const int xs#0’ previously declared here 9 | (call_cart(f, xs, xs... ), ...); // ok with gcc8 // error with gcc9 | ^~ 90623.C:9:25: error: redeclaration of ‘const int xs#2’ 9 | (call_cart(f, xs, xs... ), ...); // ok with gcc8 // error with gcc9 | ^~ 90623.C:9:25: note: ‘const int xs#2’ previously declared here 90623.C:9:21: error: redeclaration of ‘const int xs#2’ 9 | (call_cart(f, xs, xs... ), ...); // ok with gcc8 // error with gcc9 | ^~ 90623.C:9:25: note: ‘const int xs#2’ previously declared here 9 | (call_cart(f, xs, xs... ), ...); // ok with gcc8 // error with gcc9 | ^~ 90623.C:9:25: error: redeclaration of ‘const int xs#0’ 90623.C:9:21: note: ‘const int xs#0’ previously declared here 9 | (call_cart(f, xs, xs... ), ...); // ok with gcc8 // error with gcc9 | ^~ 90623.C:9:25: error: redeclaration of ‘const int xs#1’ 9 | (call_cart(f, xs, xs... ), ...); // ok with gcc8 // error with gcc9 | ^~ 90623.C:9:25: note: ‘const int xs#1’ previously declared here 90623.C:8:12: error: designator order for field ‘main()::<lambda(auto:4 ...)> [with auto:4 = {int, int, int}]::<lambda(auto:5)>::<xs#1 capture>’ does not match declaration order in ‘main()::<lambda(auto:4 ...)> [with auto:4 = {int, int, int}]::<lambda(auto:5)>’ 8 | return [=](auto f) { | ^~~~~~~~~~~~~ 9 | (call_cart(f, xs, xs... ), ...); // ok with gcc8 // error with gcc9 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 10 | // other version without fold expression // same problem | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 11 | // (void)std::initializer_list<int>{((void)call_cart(f,xs,xs...),0)...}; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 12 | }; | ~ 90623.C: In instantiation of ‘main()::<lambda(auto:4 ...)> [with auto:4 = {int, int, int}]::<lambda(auto:5)> [with auto:5 = main()::<lambda(int, int)>]’: 90623.C:17:56: required from here 90623.C:9:21: internal compiler error: in insert_capture_proxy, at cp/lambda.c:311 9 | (call_cart(f, xs, xs... ), ...); // ok with gcc8 // error with gcc9 | ^~ 0x99e0a1 insert_capture_proxy(tree_node*) /home/mpolacek/src/gcc/gcc/cp/lambda.c:311 0xab3331 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /home/mpolacek/src/gcc/gcc/cp/pt.c:17137 0xab271c tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /home/mpolacek/src/gcc/gcc/cp/pt.c:17036 0xab4d00 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /home/mpolacek/src/gcc/gcc/cp/pt.c:17330 0xad7289 instantiate_decl(tree_node*, bool, bool) /home/mpolacek/src/gcc/gcc/cp/pt.c:24760 0x95f8d2 maybe_instantiate_decl /home/mpolacek/src/gcc/gcc/cp/decl2.c:5303 0x9605b6 mark_used(tree_node*, int) /home/mpolacek/src/gcc/gcc/cp/decl2.c:5459 0x86267d build_over_call /home/mpolacek/src/gcc/gcc/cp/call.c:8646 0x852ef0 build_op_call_1 /home/mpolacek/src/gcc/gcc/cp/call.c:4768 0x8530b2 build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) /home/mpolacek/src/gcc/gcc/cp/call.c:4797 0xb0f66a finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) /home/mpolacek/src/gcc/gcc/cp/semantics.c:2601 0xa0cde9 cp_parser_postfix_expression /home/mpolacek/src/gcc/gcc/cp/parser.c:7375 0xa0f681 cp_parser_unary_expression /home/mpolacek/src/gcc/gcc/cp/parser.c:8461 0xa10adb cp_parser_cast_expression /home/mpolacek/src/gcc/gcc/cp/parser.c:9346 0xa10bc8 cp_parser_binary_expression /home/mpolacek/src/gcc/gcc/cp/parser.c:9449 0xa11986 cp_parser_assignment_expression /home/mpolacek/src/gcc/gcc/cp/parser.c:9747 0xa11d11 cp_parser_expression /home/mpolacek/src/gcc/gcc/cp/parser.c:9914 0xa07a42 cp_parser_primary_expression /home/mpolacek/src/gcc/gcc/cp/parser.c:5316 0xa0c125 cp_parser_postfix_expression /home/mpolacek/src/gcc/gcc/cp/parser.c:7167 0xa0f681 cp_parser_unary_expression /home/mpolacek/src/gcc/gcc/cp/parser.c:8461 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.