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:
parent
434e6c8a7c
commit
0429e06465
@ -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.
|
||||
|
||||
|
@ -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
|
||||
{
|
||||
|
6
gcc/testsuite/g++.dg/cpp0x/variadic148.C
Normal file
6
gcc/testsuite/g++.dg/cpp0x/variadic148.C
Normal 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" }
|
Loading…
Reference in New Issue
Block a user