* pt.c (tsubst_pack_expansion): Sorry rather than abort
on __integer_pack as subexpression of pattern.
From-SVN: r260404
+2018-05-19 Jason Merrill <jason@redhat.com>
+
+ * pt.c (tsubst_pack_expansion): Sorry rather than abort
+ on __integer_pack as subexpression of pattern.
+
2018-05-18 Jason Merrill <jason@redhat.com>
PR c++/58407 - deprecated implicit copy ops.
}
else if (builtin_pack_call_p (parm_pack))
{
- /* ??? Support use in other patterns. */
- gcc_assert (parm_pack == pattern);
+ if (parm_pack != pattern)
+ {
+ if (complain & tf_error)
+ sorry ("%qE is not the entire pattern of the pack expansion",
+ parm_pack);
+ return error_mark_node;
+ }
return expand_builtin_pack_call (parm_pack, args,
complain, in_decl);
}
--- /dev/null
+// { dg-additional-options -std=c++17 }
+
+template<int ... Ns> int f() { return (Ns + ...); }
+template<int N> int g() {
+ return f<__integer_pack(N)...>(); // Fine.
+}
+template<int N> int h() {
+ return f<(2*__integer_pack(N))...>(); // { dg-bogus "sorry" "" { xfail *-*-* } }
+}
+int main() { return g<3>()+h<3>(); }