Commit b0ff7fe1 by Jason Merrill Committed by Jason Merrill

re PR c++/54440 ([c++11] g++ prematurely applying rule that a template parameter…

re PR c++/54440 ([c++11] g++ prematurely applying rule that a template parameter pack cannot be followed by a template parameter)

	PR c++/54440
	* pt.c (get_template_parm_index): New.
	(fixed_parameter_pack_p_1, fixed_parameter_pack_p): New.
	(process_template_parm): Allow bare packs in template template
	parm template parms.
	(coerce_template_parameter_pack): Handle fixed template template
	parm packs and fixed packs not at the end of the parm list.
	(coerce_template_parms): Handle template parm packs not at the end
	of the parm list.
	(gen_elem_of_pack_expansion_instantiation): Handle a decl expansion.

From-SVN: r208178
parent f3417723
2014-02-26 Jason Merrill <jason@redhat.com>
PR c++/54440
* pt.c (get_template_parm_index): New.
(fixed_parameter_pack_p_1, fixed_parameter_pack_p): New.
(process_template_parm): Allow bare packs in template template
parm template parms.
(coerce_template_parameter_pack): Handle fixed template template
parm packs and fixed packs not at the end of the parm list.
(coerce_template_parms): Handle template parm packs not at the end
of the parm list.
(gen_elem_of_pack_expansion_instantiation): Handle a decl expansion.
PR c++/60182
* pt.c (unify): Ignore alias templates when deducing a template
template parameter.
......
// PR c++/54440
// { dg-do compile { target c++11 } }
template <class...T> struct A
{
template <T... t, class U> struct B { };
};
A<int,char>::B<42,'a',float> b;
// PR c++/54440
// { dg-do compile { target c++11 } }
template <class...T> struct A
{
template <template <T> class... TP, class U> struct B { };
};
template <int I> struct C { };
template <char C> struct D { };
A<int,char>::B<C,D,float> b;
......@@ -24,3 +24,5 @@ A<int*, float*>::X<&i> apple2; // { dg-error "wrong number of template arguments
A<int*, float*>::X<&i, &f, &f> apple3; // { dg-error "wrong number of template arguments" "wrong number" }
// { dg-error "invalid type" "invalid" { target *-*-* } 24 }
A<int, float> apple4;
// { dg-prune-output "provided for" }
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