re PR c++/59989 (ICE when a template parameter pack is explicitly specified for a function template and provides a complete argument list for a template)

PR c++/59989
	* pt.c (expand_template_argument_pack): Correct
	non_default_args_count calculation.

From-SVN: r207285
This commit is contained in:
Jason Merrill 2014-01-29 17:12:09 -05:00 committed by Jason Merrill
parent 434e6c8a7c
commit 0429e06465
3 changed files with 11 additions and 1 deletions

View File

@ -1,5 +1,9 @@
2014-01-29 Jason Merrill <jason@redhat.com>
PR c++/59989
* pt.c (expand_template_argument_pack): Correct
non_default_args_count calculation.
PR c++/58466
* pt.c (unify_pack_expansion): Call expand_template_argument_pack.

View File

@ -3471,7 +3471,7 @@ expand_template_argument_pack (tree args)
for (i = 0; i < num_packed; ++i, ++out_arg)
TREE_VEC_ELT (result_args, out_arg) = TREE_VEC_ELT(packed, i);
if (non_default_args_count > 0)
non_default_args_count += num_packed;
non_default_args_count += num_packed - 1;
}
else
{

View File

@ -0,0 +1,6 @@
// PR c++/59989
// { dg-require-effective-target c++11 }
template<typename T> struct X {};
template<template<typename...> class D, typename ...U> int test(D<U...>*);
int n = test<X, int>(0); // { dg-error "no match" }