Commit 21554a3e by Adam Butcher Committed by Adam Butcher

re PR c++/60627 ([c++1y] ICE in explicit template instantiation containing auto parameter)

Fix PR c++/60627

	PR c++/60627
	* parser.c (cp_parser_parameter_declaration_clause): Prevent 'auto' from
	introducing an implicit function template parameter within an explicit
	instantiation.

	PR c++/60627
	* g++.dg/cpp1y/pr60627.C: New testcase.

From-SVN: r208799
parent 09f15d1b
2014-03-24 Adam Butcher <adam@jessamine.co.uk>
PR c++/60627
* parser.c (cp_parser_parameter_declaration_clause): Prevent 'auto' from
introducing an implicit function template parameter within an explicit
instantiation.
2014-03-22 Jason Merrill <jason@redhat.com>
PR c++/60574
......
......@@ -18207,7 +18207,9 @@ cp_parser_parameter_declaration_clause (cp_parser* parser)
(void) cleanup;
if (!processing_specialization && !processing_template_parmlist)
if (!processing_specialization
&& !processing_template_parmlist
&& !processing_explicit_instantiation)
if (!current_function_decl
|| (current_class_type && LAMBDA_TYPE_P (current_class_type)))
parser->auto_is_implicit_function_template_parm_p = true;
......
2014-03-24 Adam Butcher <adam@jessamine.co.uk>
PR c++/60627
* g++.dg/cpp1y/pr60627.C: New testcase.
2014-03-24 Alex Velenko <Alex.Velenko@arm.com>
* gcc.target/aarch64/ushr64_1.c: New.
......
// PR c++/60627
// { dg-do compile { target c++1y } }
// { dg-options "" }
template<typename T> void foo(T) {}
template void foo(auto); // { dg-error "auto|does not match" }
void bar()
{
foo(0);
}
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