Commit 7a9a6e24 by Adam Butcher Committed by Adam Butcher

Fix instantiation of implicit function template forward declarations.

	* parser.c (cp_parser_init_declarator): Defer calling
	finish_fully_implicit_template for forward declarations until after
	other decl processing is complete.  Cleanup for clarity: Extract 'else'
	case after 'if' containing unconditional return.

From-SVN: r202850
parent 1a4109b6
2013-09-23 Adam Butcher <adam@jessamine.co.uk>
* parser.c (cp_parser_init_declarator): Defer calling
finish_fully_implicit_template for forward declarations until after
other decl processing is complete. Cleanup for clarity: Extract 'else'
case after 'if' containing unconditional return.
2013-09-23 Adam Butcher <adam@jessamine.co.uk>
* parser.c (make_generic_type_name): Spell generic type names '<autoN>'
rather than '__GenN'.
......
......@@ -16318,8 +16318,7 @@ cp_parser_init_declarator (cp_parser* parser,
"a function-definition is not allowed here");
return error_mark_node;
}
else
{
location_t func_brace_location
= cp_lexer_peek_token (parser->lexer)->location;
......@@ -16357,9 +16356,6 @@ cp_parser_init_declarator (cp_parser* parser,
return decl;
}
}
else if (parser->fully_implicit_function_template_p)
decl = finish_fully_implicit_template (parser, decl);
}
/* [dcl.dcl]
......@@ -16581,6 +16577,15 @@ cp_parser_init_declarator (cp_parser* parser,
if (!friend_p && pushed_scope)
pop_scope (pushed_scope);
if (function_declarator_p (declarator)
&& parser->fully_implicit_function_template_p)
{
if (member_p)
decl = finish_fully_implicit_template (parser, decl);
else
finish_fully_implicit_template (parser, /*member_decl_opt=*/0);
}
return decl;
}
......
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