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
This commit is contained in:
parent
0208f7dab0
commit
4185fb7350
3 changed files with 22 additions and 2 deletions
|
@ -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-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;
|
||||
}
|
||||
|
|
14
gcc/testsuite/g++.dg/cpp0x/variadic-explicit2.C
Normal file
14
gcc/testsuite/g++.dg/cpp0x/variadic-explicit2.C
Normal 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>() );
|
||||
}
|
Loading…
Add table
Reference in a new issue