aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f550a450d3d..744b4617b2d 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -18563,14 +18563,19 @@ type_unification_real (tree tparms,
if (DECL_P (parm))
input_location = DECL_SOURCE_LOCATION (parm);
arg = tsubst_template_arg (arg, targs, complain, NULL_TREE);
- arg = convert_template_argument (parm, arg, targs, complain,
- i, NULL_TREE);
+ if (!uses_template_parms (arg))
+ arg = convert_template_argument (parm, arg, targs, complain,
+ i, NULL_TREE);
+ else if (saw_undeduced < 2)
+ arg = NULL_TREE;
+ else
+ arg = error_mark_node;
input_location = save_loc;
*checks = get_deferred_access_checks ();
pop_deferring_access_checks ();
if (arg == error_mark_node)
return 1;
- else
+ else if (arg)
{
TREE_VEC_ELT (targs, i) = arg;
/* The position of the first default template argument,
@@ -18578,7 +18583,6 @@ type_unification_real (tree tparms,
Record that. */
if (!NON_DEFAULT_TEMPLATE_ARGS_COUNT (targs))
SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (targs, i);
- continue;
}
}