re PR c++/56774 (G++ 4.8 reverses variadic template types during unpacking)

PR c++/56774
	PR c++/35722
	* pt.c (unify_pack_expansion): Fix indexing.

From-SVN: r197246
This commit is contained in:
Jason Merrill 2013-03-29 14:59:35 -04:00 committed by Jason Merrill
parent 8864ab3534
commit 6e46441224
3 changed files with 22 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2013-03-29 Jason Merrill <jason@redhat.com>
PR c++/56774
PR c++/35722
* pt.c (unify_pack_expansion): Fix indexing.
2013-03-23 Jason Merrill <jason@redhat.com>
PR c++/54277

View File

@ -15727,10 +15727,10 @@ unify_pack_expansion (tree tparms, tree targs, tree packed_parms,
arg = NULL_TREE;
if (TREE_VALUE (pack)
&& (pargs = ARGUMENT_PACK_EXPLICIT_ARGS (TREE_VALUE (pack)))
&& (i < TREE_VEC_LENGTH (pargs)))
&& (i - start < TREE_VEC_LENGTH (pargs)))
{
any_explicit = true;
arg = TREE_VEC_ELT (pargs, i);
arg = TREE_VEC_ELT (pargs, i - start);
}
TMPL_ARG (targs, level, idx) = arg;
}

View File

@ -0,0 +1,14 @@
// PR c++/56774
// { dg-require-effective-target c++11 }
template <class ... Args>
struct mytype {};
template <class T, class ... Args>
void something( mytype<T, Args...> )
{ }
int main()
{
something<int, char, bool>( mytype<int, char, bool>() );
}