When cp_unevaluated_operand is set, tsubst_decl thinks that if it sees a
PARM_DECL that isn't already in local_specializations, we're in a decltype
in a trailing return type or some such, and so we only want a substitution
for a single PARM_DECL. In this case, we want the whole chain, so make sure
cp_unevaluated_operand is cleared.
gcc/cp/ChangeLog
2020-03-14 Jason Merrill <jason@redhat.com>
PR c++/93248
* pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
substituting DECL_ARGUMENTS.
+2020-03-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/93248
+ * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
+ substituting DECL_ARGUMENTS.
+
2020-03-14 Jakub Jelinek <jakub@redhat.com>
* logic.cc (formula::formula): Change "a an" to "an" in a comment.
complain, ctor);
if (fparms == error_mark_node)
ok = false;
- fargs = tsubst (fargs, tsubst_args, complain, ctor);
if (ci)
ci = tsubst_constraint_info (ci, tsubst_args, complain, ctor);
+ /* Parms are to have DECL_CHAIN tsubsted, which would be skipped if
+ cp_unevaluated_operand. */
+ cp_evaluated ev;
+ fargs = tsubst (fargs, tsubst_args, complain, ctor);
current_template_parms = save_parms;
}
--- /dev/null
+// PR c++/93248
+// { dg-do compile { target c++17 } }
+
+template <typename T> struct S
+{ template <typename V> S (T, V, long = 0); };
+using U = decltype(S{0, 4u});