From d4db50606926a56219b6952cd84d4f0880d12799 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 22 Oct 2015 20:51:07 -0400 Subject: [PATCH] call.c (add_conv_candidate): Remove first_arg parm. * call.c (add_conv_candidate): Remove first_arg parm. (add_template_conv_candidate): Likewise. (add_template_candidate_real): Don't pass it. (build_op_call_1): Likewise. From-SVN: r229209 --- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/call.c | 25 ++++++++++--------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8dbff11574c..05ffbdc4d5a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2015-10-22 Jason Merrill + + * call.c (add_conv_candidate): Remove first_arg parm. + (add_template_conv_candidate): Likewise. + (add_template_candidate_real): Don't pass it. + (build_op_call_1): Likewise. + 2015-10-22 Richard Biener * semantics.c (cp_finish_omp_clause_depend_sink): Properly convert diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 55b3c8c88bb..9304aac5f3f 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -178,9 +178,6 @@ static struct z_candidate *add_template_candidate static struct z_candidate *add_template_candidate_real (struct z_candidate **, tree, tree, tree, tree, const vec *, tree, tree, tree, int, tree, unification_kind_t, tsubst_flags_t); -static struct z_candidate *add_template_conv_candidate - (struct z_candidate **, tree, tree, tree, const vec *, - tree, tree, tree, tsubst_flags_t); static void add_builtin_candidates (struct z_candidate **, enum tree_code, enum tree_code, tree, tree *, int, tsubst_flags_t); @@ -192,7 +189,7 @@ static void build_builtin_candidate (struct z_candidate **, tree, tree, tree, tree *, tree *, int, tsubst_flags_t); static struct z_candidate *add_conv_candidate - (struct z_candidate **, tree, tree, tree, const vec *, tree, + (struct z_candidate **, tree, tree, const vec *, tree, tree, tsubst_flags_t); static struct z_candidate *add_function_candidate (struct z_candidate **, tree, tree, tree, const vec *, tree, @@ -2176,7 +2173,7 @@ add_function_candidate (struct z_candidate **candidates, static struct z_candidate * add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj, - tree first_arg, const vec *arglist, + const vec *arglist, tree access_path, tree conversion_path, tsubst_flags_t complain) { @@ -2190,7 +2187,7 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj, parmlist = TREE_TYPE (parmlist); parmlist = TYPE_ARG_TYPES (parmlist); - len = vec_safe_length (arglist) + (first_arg != NULL_TREE ? 1 : 0) + 1; + len = vec_safe_length (arglist) + 1; convs = alloc_conversions (len); parmnode = parmlist; viable = 1; @@ -2208,10 +2205,8 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj, if (i == 0) arg = obj; - else if (i == 1 && first_arg != NULL_TREE) - arg = first_arg; else - arg = (*arglist)[i - (first_arg != NULL_TREE ? 1 : 0) - 1]; + arg = (*arglist)[i - 1]; argtype = lvalue_type (arg); if (i == 0) @@ -2260,7 +2255,7 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj, reason = arity_rejection (NULL_TREE, i + remaining, len); } - return add_candidate (candidates, totype, first_arg, arglist, len, convs, + return add_candidate (candidates, totype, obj, arglist, len, convs, access_path, conversion_path, viable, reason, flags); } @@ -3122,7 +3117,7 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl, if (obj != NULL_TREE) /* Aha, this is a conversion function. */ - cand = add_conv_candidate (candidates, fn, obj, first_arg, arglist, + cand = add_conv_candidate (candidates, fn, obj, arglist, access_path, conversion_path, complain); else cand = add_function_candidate (candidates, fn, ctype, @@ -3175,14 +3170,14 @@ add_template_candidate (struct z_candidate **candidates, tree tmpl, tree ctype, static struct z_candidate * add_template_conv_candidate (struct z_candidate **candidates, tree tmpl, - tree obj, tree first_arg, + tree obj, const vec *arglist, tree return_type, tree access_path, tree conversion_path, tsubst_flags_t complain) { return add_template_candidate_real (candidates, tmpl, NULL_TREE, NULL_TREE, - first_arg, arglist, return_type, access_path, + NULL_TREE, arglist, return_type, access_path, conversion_path, 0, obj, DEDUCE_CONV, complain); } @@ -4335,11 +4330,11 @@ build_op_call_1 (tree obj, vec **args, tsubst_flags_t complain) if (TREE_CODE (fn) == TEMPLATE_DECL) add_template_conv_candidate - (&candidates, fn, obj, NULL_TREE, *args, totype, + (&candidates, fn, obj, *args, totype, /*access_path=*/NULL_TREE, /*conversion_path=*/NULL_TREE, complain); else - add_conv_candidate (&candidates, fn, obj, NULL_TREE, + add_conv_candidate (&candidates, fn, obj, *args, /*conversion_path=*/NULL_TREE, /*access_path=*/NULL_TREE, complain); } -- 2.30.2