@@ -14076,7 +14076,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
/* Zero-length parameter packs are boring. Just substitute
into the chain. */
- if (len == 0)
+ if (len == 0 && !cp_unevaluated_operand)
RETURN (tsubst (TREE_CHAIN (t), args, complain,
TREE_CHAIN (t)));
}
new file mode 100644
@@ -0,0 +1,17 @@
+// PR c++/93140
+// { dg-do compile { target c++11 } }
+
+int
+bar ()
+{
+ return 42;
+}
+
+template <typename... R>
+void foo (R... r, decltype (bar (r...)) x = 0) {}
+
+int
+main ()
+{
+ foo (3);
+}