@@ -20918,8 +20918,13 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
case INDIRECT_REF:
if (REFERENCE_REF_P (parm))
{
+ bool pexp = PACK_EXPANSION_P (arg);
+ if (pexp)
+ arg = PACK_EXPANSION_PATTERN (arg);
if (REFERENCE_REF_P (arg))
arg = TREE_OPERAND (arg, 0);
+ if (pexp)
+ arg = make_pack_expansion (arg);
return unify (tparms, targs, TREE_OPERAND (parm, 0), arg,
strict, explain_p);
}
new file mode 100644
@@ -0,0 +1,10 @@
+// PR c++/79470
+// { dg-do compile { target c++11 } }
+
+ template < const int&... > struct AA;
+
+ template < > struct AA<> { };
+
+ template < const int& II, const int&... Is >
+ struct AA<II,Is...> { };
+