Commit d4db5060 by Jason Merrill Committed by Jason Merrill

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
parent cfed1924
2015-10-22 Jason Merrill <jason@redhat.com>
* 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 <rguenther@suse.de> 2015-10-22 Richard Biener <rguenther@suse.de>
* semantics.c (cp_finish_omp_clause_depend_sink): Properly convert * semantics.c (cp_finish_omp_clause_depend_sink): Properly convert
......
...@@ -178,9 +178,6 @@ static struct z_candidate *add_template_candidate ...@@ -178,9 +178,6 @@ static struct z_candidate *add_template_candidate
static struct z_candidate *add_template_candidate_real static struct z_candidate *add_template_candidate_real
(struct z_candidate **, tree, tree, tree, tree, const vec<tree, va_gc> *, (struct z_candidate **, tree, tree, tree, tree, const vec<tree, va_gc> *,
tree, tree, tree, int, tree, unification_kind_t, tsubst_flags_t); 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, va_gc> *,
tree, tree, tree, tsubst_flags_t);
static void add_builtin_candidates static void add_builtin_candidates
(struct z_candidate **, enum tree_code, enum tree_code, (struct z_candidate **, enum tree_code, enum tree_code,
tree, tree *, int, tsubst_flags_t); tree, tree *, int, tsubst_flags_t);
...@@ -192,7 +189,7 @@ static void build_builtin_candidate ...@@ -192,7 +189,7 @@ static void build_builtin_candidate
(struct z_candidate **, tree, tree, tree, tree *, tree *, (struct z_candidate **, tree, tree, tree, tree *, tree *,
int, tsubst_flags_t); int, tsubst_flags_t);
static struct z_candidate *add_conv_candidate static struct z_candidate *add_conv_candidate
(struct z_candidate **, tree, tree, tree, const vec<tree, va_gc> *, tree, (struct z_candidate **, tree, tree, const vec<tree, va_gc> *, tree,
tree, tsubst_flags_t); tree, tsubst_flags_t);
static struct z_candidate *add_function_candidate static struct z_candidate *add_function_candidate
(struct z_candidate **, tree, tree, tree, const vec<tree, va_gc> *, tree, (struct z_candidate **, tree, tree, tree, const vec<tree, va_gc> *, tree,
...@@ -2176,7 +2173,7 @@ add_function_candidate (struct z_candidate **candidates, ...@@ -2176,7 +2173,7 @@ add_function_candidate (struct z_candidate **candidates,
static struct z_candidate * static struct z_candidate *
add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj, add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj,
tree first_arg, const vec<tree, va_gc> *arglist, const vec<tree, va_gc> *arglist,
tree access_path, tree conversion_path, tree access_path, tree conversion_path,
tsubst_flags_t complain) tsubst_flags_t complain)
{ {
...@@ -2190,7 +2187,7 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj, ...@@ -2190,7 +2187,7 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj,
parmlist = TREE_TYPE (parmlist); parmlist = TREE_TYPE (parmlist);
parmlist = TYPE_ARG_TYPES (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); convs = alloc_conversions (len);
parmnode = parmlist; parmnode = parmlist;
viable = 1; viable = 1;
...@@ -2208,10 +2205,8 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj, ...@@ -2208,10 +2205,8 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj,
if (i == 0) if (i == 0)
arg = obj; arg = obj;
else if (i == 1 && first_arg != NULL_TREE)
arg = first_arg;
else else
arg = (*arglist)[i - (first_arg != NULL_TREE ? 1 : 0) - 1]; arg = (*arglist)[i - 1];
argtype = lvalue_type (arg); argtype = lvalue_type (arg);
if (i == 0) if (i == 0)
...@@ -2260,7 +2255,7 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj, ...@@ -2260,7 +2255,7 @@ add_conv_candidate (struct z_candidate **candidates, tree fn, tree obj,
reason = arity_rejection (NULL_TREE, i + remaining, len); 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); access_path, conversion_path, viable, reason, flags);
} }
...@@ -3122,7 +3117,7 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl, ...@@ -3122,7 +3117,7 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl,
if (obj != NULL_TREE) if (obj != NULL_TREE)
/* Aha, this is a conversion function. */ /* 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); access_path, conversion_path, complain);
else else
cand = add_function_candidate (candidates, fn, ctype, cand = add_function_candidate (candidates, fn, ctype,
...@@ -3175,14 +3170,14 @@ add_template_candidate (struct z_candidate **candidates, tree tmpl, tree ctype, ...@@ -3175,14 +3170,14 @@ add_template_candidate (struct z_candidate **candidates, tree tmpl, tree ctype,
static struct z_candidate * static struct z_candidate *
add_template_conv_candidate (struct z_candidate **candidates, tree tmpl, add_template_conv_candidate (struct z_candidate **candidates, tree tmpl,
tree obj, tree first_arg, tree obj,
const vec<tree, va_gc> *arglist, const vec<tree, va_gc> *arglist,
tree return_type, tree access_path, tree return_type, tree access_path,
tree conversion_path, tsubst_flags_t complain) tree conversion_path, tsubst_flags_t complain)
{ {
return return
add_template_candidate_real (candidates, tmpl, NULL_TREE, NULL_TREE, 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, conversion_path, 0, obj, DEDUCE_CONV,
complain); complain);
} }
...@@ -4335,11 +4330,11 @@ build_op_call_1 (tree obj, vec<tree, va_gc> **args, tsubst_flags_t complain) ...@@ -4335,11 +4330,11 @@ build_op_call_1 (tree obj, vec<tree, va_gc> **args, tsubst_flags_t complain)
if (TREE_CODE (fn) == TEMPLATE_DECL) if (TREE_CODE (fn) == TEMPLATE_DECL)
add_template_conv_candidate add_template_conv_candidate
(&candidates, fn, obj, NULL_TREE, *args, totype, (&candidates, fn, obj, *args, totype,
/*access_path=*/NULL_TREE, /*access_path=*/NULL_TREE,
/*conversion_path=*/NULL_TREE, complain); /*conversion_path=*/NULL_TREE, complain);
else else
add_conv_candidate (&candidates, fn, obj, NULL_TREE, add_conv_candidate (&candidates, fn, obj,
*args, /*conversion_path=*/NULL_TREE, *args, /*conversion_path=*/NULL_TREE,
/*access_path=*/NULL_TREE, complain); /*access_path=*/NULL_TREE, complain);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment