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

            Bug ID: 63385
           Summary: internal compiler error: in pop_binding, at
                    cp/name-lookup.c for implicitly captured variable
                    called closure
           Product: gcc
           Version: 4.8.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kretz at kde dot org

Testcase:

template <typename F> void f(F closure) { auto g = [&]() { return closure; }; }

Compile with 'g++ -std=c++11'. Output with gcc 4.8.3:
internal compiler error: in pop_binding, at cp/name-lookup.c:382
 template <typename F> void f(F closure) { auto g = [=]() { return closure; };
}
                                                                            ^
0x5fadd9 pop_binding(tree_node*, tree_node*)
        ../.././gcc/cp/name-lookup.c:382
0x52e92b poplevel(int, int, int)
        ../.././gcc/cp/decl.c:731
0x538cf8 finish_function(int)
        ../.././gcc/cp/decl.c:13845
0x58b167 cp_parser_lambda_body
        ../.././gcc/cp/parser.c:8766
0x58b167 cp_parser_lambda_expression
        ../.././gcc/cp/parser.c:8295
0x58b167 cp_parser_primary_expression
        ../.././gcc/cp/parser.c:4104
0x592e10 cp_parser_postfix_expression
        ../.././gcc/cp/parser.c:5667
0x5916fd cp_parser_unary_expression
        ../.././gcc/cp/parser.c:6732
0x59684f cp_parser_binary_expression
        ../.././gcc/cp/parser.c:7424
0x596cff cp_parser_assignment_expression
        ../.././gcc/cp/parser.c:7660
0x597134 cp_parser_assignment_expression
        ../.././gcc/cp/parser.c:7710
0x597134 cp_parser_constant_expression
        ../.././gcc/cp/parser.c:7920
0x5a5afc cp_parser_init_declarator
        ../.././gcc/cp/parser.c:16079
0x5a601e cp_parser_simple_declaration
        ../.././gcc/cp/parser.c:10670
0x5a1920 cp_parser_block_declaration
        ../.././gcc/cp/parser.c:10551
0x5a2940 cp_parser_declaration_statement
        ../.././gcc/cp/parser.c:10195
0x5a2fe7 cp_parser_statement
        ../.././gcc/cp/parser.c:8969
0x5a41de cp_parser_statement_seq_opt
        ../.././gcc/cp/parser.c:9241
0x5a42fe cp_parser_compound_statement
        ../.././gcc/cp/parser.c:9195
0x5a4448 cp_parser_function_body
        ../.././gcc/cp/parser.c:17816

4.9.x compiles the code fine.

Reply via email to