commit 4b4cf682c8f7d15d3cf3097a2f4cf4f7f4f6acb5
Author: Jason Merrill <jason@redhat.com>
Date: Fri Mar 29 14:25:12 2013 -0400
PR c++/56774
PR c++/35722
* pt.c (unify_pack_expansion): Fix indexing.
@@ -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;
}
new file mode 100644
@@ -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>() );
+}