From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5789 invoked by alias); 3 Oct 2013 21:56:19 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 5760 invoked by uid 48); 3 Oct 2013 21:56:17 -0000 From: "reichelt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58613] New: [4.9 Regression] [c++1y] ICE with invalid lambda capture Date: Thu, 03 Oct 2013 21:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: reichelt at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-10/txt/msg00190.txt.bz2 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.]