[Bug c++/84518] [8 Regression] ICE with lambda capturing broken variable

reichelt at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 22 18:17:00 GMT 2018


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

--- Comment #1 from Volker Reichelt <reichelt at gcc dot gnu.org> ---
A modified testcase produces a slightly different stack-trace:

====================================
template<typename T> void foo()
{
  T x[=];
  [&x]{};
}
====================================

bug.cc: In function 'void foo()':
bug.cc:3:7: error: expected primary-expression before '=' token
   T x[=];
       ^
bug.cc:3:8: error: expected primary-expression before ']' token
   T x[=];
        ^
bug.cc: In lambda function:
bug.cc:4:6: internal compiler error: in is_normal_capture_proxy, at
cp/lambda.c:289
   [&x]{};
      ^
0x614602 is_normal_capture_proxy(tree_node*)
        ../../gcc/gcc/cp/lambda.c:289
0x8d4918 is_capture_proxy_with_ref(tree_node*)
        ../../gcc/gcc/cp/lambda.c:301
0x8d49ad insert_capture_proxy(tree_node*)
        ../../gcc/gcc/cp/lambda.c:311
0x8d546f build_capture_proxy(tree_node*, tree_node*)
        ../../gcc/gcc/cp/lambda.c:474
0x8d8596 start_lambda_function(tree_node*, tree_node*)
        ../../gcc/gcc/cp/lambda.c:1374
0x91daad cp_parser_lambda_body
        ../../gcc/gcc/cp/parser.c:10662
0x91daad cp_parser_lambda_expression
        ../../gcc/gcc/cp/parser.c:10182
0x91daad cp_parser_primary_expression
        ../../gcc/gcc/cp/parser.c:5257
0x93043c cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:7026
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
Please submit a full bug report, [etc.]


More information about the Gcc-bugs mailing list