Commit 0b2513e2 by Paolo Carlini Committed by Paolo Carlini

re PR c++/84446 (ICE with broken lambda)

/cp
2018-02-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84446
	* parser.c (cp_parser_init_declarator): Don't call start_lambda_scope
	on error_mark_node.

/testsuite
2018-02-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84446
	* g++.dg/cpp0x/lambda/lambda-ice27.C: New.

From-SVN: r257841
parent 393d9df7
2018-02-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84446
* parser.c (cp_parser_init_declarator): Don't call start_lambda_scope
on error_mark_node.
2018-02-20 Jakub Jelinek <jakub@redhat.com> 2018-02-20 Jakub Jelinek <jakub@redhat.com>
PR c++/84445 PR c++/84445
......
...@@ -19650,12 +19650,12 @@ cp_parser_init_declarator (cp_parser* parser, ...@@ -19650,12 +19650,12 @@ cp_parser_init_declarator (cp_parser* parser,
member templates. The former involves deferring member templates. The former involves deferring
parsing of the initializer until end of class as with default parsing of the initializer until end of class as with default
arguments. So right here we only handle the latter. */ arguments. So right here we only handle the latter. */
if (!member_p && processing_template_decl) if (!member_p && processing_template_decl && decl != error_mark_node)
start_lambda_scope (decl); start_lambda_scope (decl);
initializer = cp_parser_initializer (parser, initializer = cp_parser_initializer (parser,
&is_direct_init, &is_direct_init,
&is_non_constant_init); &is_non_constant_init);
if (!member_p && processing_template_decl) if (!member_p && processing_template_decl && decl != error_mark_node)
finish_lambda_scope (); finish_lambda_scope ();
if (initializer == error_mark_node) if (initializer == error_mark_node)
cp_parser_skip_to_end_of_statement (parser); cp_parser_skip_to_end_of_statement (parser);
2018-02-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84446
* g++.dg/cpp0x/lambda/lambda-ice27.C: New.
2018-02-20 Jakub Jelinek <jakub@redhat.com> 2018-02-20 Jakub Jelinek <jakub@redhat.com>
PR c++/84445 PR c++/84445
......
// PR c++/84446
// { dg-do compile { target c++11 } }
template<int> void foo()
{
int i,
i = [] { virtual }(); // { dg-error "redeclaration|expected" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment