Commit 4185fb73 by Jason Merrill Committed by Jason Merrill

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: r197244
parent 0208f7da
2013-03-29 Jason Merrill <jason@redhat.com>
PR c++/56774
PR c++/35722
* pt.c (unify_pack_expansion): Fix indexing.
2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
* call.c (build_java_interface_fn_ref): Likewise.
......
......@@ -16213,10 +16213,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;
}
......
// 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>() );
}
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