Commit 234b1504 by Adam Butcher Committed by Adam Butcher

re PR c++/60377 ([c++1y] ICE with invalid function parameter in conjunction with auto parameter)

Fix PR c++/60377.

	PR c++/60377
	* parser.c (cp_parser_parameter_declaration_clause): Unwind generic
	function scope on parse error in function parameter list.

	PR c++/60377
	* g++.dg/cpp1y/pr60377.C: New testcase.

From-SVN: r208250
parent 2ce29890
2014-03-01 Adam Butcher <adam@jessamine.co.uk>
PR c++/60377
* parser.c (cp_parser_parameter_declaration_clause): Unwind generic
function scope on parse error in function parameter list.
2014-03-01 Paolo Carlini <paolo.carlini@oracle.com> 2014-03-01 Paolo Carlini <paolo.carlini@oracle.com>
* method.c (implicitly_declare_fn): Remove redundant * method.c (implicitly_declare_fn): Remove redundant
......
...@@ -18208,7 +18208,12 @@ cp_parser_parameter_declaration_clause (cp_parser* parser) ...@@ -18208,7 +18208,12 @@ cp_parser_parameter_declaration_clause (cp_parser* parser)
parameter-declaration-list, then the entire parameter-declaration-list, then the entire
parameter-declaration-clause is erroneous. */ parameter-declaration-clause is erroneous. */
if (is_error) if (is_error)
{
/* Unwind generic function template scope if necessary. */
if (parser->fully_implicit_function_template_p)
finish_fully_implicit_template (parser, /*member_decl_opt=*/0);
return NULL; return NULL;
}
/* Peek at the next token. */ /* Peek at the next token. */
token = cp_lexer_peek_token (parser->lexer); token = cp_lexer_peek_token (parser->lexer);
......
2014-03-01 Adam Butcher <adam@jessamine.co.uk>
PR c++/60377
* g++.dg/cpp1y/pr60377.C: New testcase.
2014-03-01 Mikael Morin <mikael@gcc.gnu.org> 2014-03-01 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/60341 PR fortran/60341
......
// PR c++/60377
// { dg-options -std=c++1y }
void foo(auto, void (f*)()); // { dg-error "expected" }
struct A
{
int i;
};
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