+2020-03-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/92068
+ * pt.c (process_partial_specialization): Error rather than crash on
+ extra pack expansion.
+
2020-03-14 Jason Merrill <jason@redhat.com>
PR c++/92909
return decl;
}
+ else if (nargs > DECL_NTPARMS (maintmpl))
+ {
+ error ("too many arguments for partial specialization %qT", type);
+ inform (DECL_SOURCE_LOCATION (maintmpl), "primary template here");
+ /* Avoid crash below. */
+ return decl;
+ }
+
/* If we aren't in a dependent class, we can actually try deduction. */
else if (tpd.level == 1
/* FIXME we should be able to handle a partial specialization of a
Also, we verify that pack expansions only occur at the
end of the argument list. */
- gcc_assert (nargs == DECL_NTPARMS (maintmpl));
tpd2.parms = 0;
for (i = 0; i < nargs; ++i)
{
--- /dev/null
+// PR c++/92068
+// { dg-do compile { target c++11 } }
+
+template <typename, typename> struct a;
+template <typename b, typename c, typename... d>
+struct a<b, c, d...> { }; // { dg-error "arguments" }