* pt.c (tsubst_pack_expansion): Set cp_unevaluated_operand while
instantiating dummy parms.
From-SVN: r258500
2018-03-13 Jason Merrill <jason@redhat.com>
+ PR c++/84839 - ICE with decltype of parameter pack.
+ * pt.c (tsubst_pack_expansion): Set cp_unevaluated_operand while
+ instantiating dummy parms.
+
* parser.c (cp_parser_simple_type_specifier): Pedwarn about auto
parameter even without -Wpedantic.
{
/* This parameter pack was used in an unevaluated context. Just
make a dummy decl, since it's only used for its type. */
+ ++cp_unevaluated_operand;
arg_pack = tsubst_decl (parm_pack, args, complain);
+ --cp_unevaluated_operand;
if (arg_pack && DECL_PACK_P (arg_pack))
/* Partial instantiation of the parm_pack, we can't build
up an argument pack yet. */
--- /dev/null
+// PR c++/84839
+// { dg-do compile { target c++11 } }
+
+template<typename... T>
+struct S {
+ using fptr = void(*)(T... x, decltype(x)... y);
+};
+
+using F = S<int>::fptr;