http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58613

            Bug ID: 58613
           Summary: [4.9 Regression] [c++1y] ICE with invalid lambda
                    capture
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following invalid code snippet (compiled with "-std=c++1y") triggers an ICE
on trunk (since at least 4.9.0 20130920):

=======================
void foo(int i)
{
  [i()](){};
}
=======================

bug.cc: In function 'void foo(int)':
bug.cc:3:6: internal compiler error: Segmentation fault
   [i()](){};
      ^
0xaef62f crash_signal
        ../../gcc/gcc/toplev.c:335
0x72286d add_capture(tree_node*, tree_node*, tree_node*, bool, bool)
        ../../gcc/gcc/cp/lambda.c:444
0x63ebab cp_parser_lambda_introducer
        ../../gcc/gcc/cp/parser.c:8797
0x63ebab cp_parser_lambda_expression
        ../../gcc/gcc/cp/parser.c:8540
0x63ebab cp_parser_primary_expression
        ../../gcc/gcc/cp/parser.c:4230
0x6418b0 cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:5814
0x64407d cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:7009
0x644c4f cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:7701
0x64510f cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:7937
0x646f73 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8099
0x64777e cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8138
0x64777e cp_parser_expression_statement
        ../../gcc/gcc/cp/parser.c:9429
0x63d0b7 cp_parser_statement
        ../../gcc/gcc/cp/parser.c:9280
0x63e3a2 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:9552
0x63e4e6 cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:9506
0x64f89b cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:18319
0x64f89b cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:18355
0x6508ef cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:22340
0x651605 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:22261
0x651605 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16348
Please submit a full bug report, [etc.]

Reply via email to