summaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 6817bfc25a0..425ef9bcd95 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -216,7 +216,6 @@ static void add_candidates (tree, tree, const vec<tree, va_gc> *, tree, tree,
bool, tree, tree, int, struct z_candidate **,
tsubst_flags_t);
static conversion *merge_conversion_sequences (conversion *, conversion *);
-static bool magic_varargs_p (tree);
static tree build_temp (tree, tree, int, diagnostic_t *, tsubst_flags_t);
/* Returns nonzero iff the destructor name specified in NAME matches BASETYPE.
@@ -5857,16 +5856,9 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
else if (t->kind == ck_identity)
break;
}
-
- if (flag_enable_cilkplus
- && (contains_array_notation_expr (expr)
- || contains_array_notation_expr (fn)))
- /* If we are using array notations, we fix them up at a later stage
- and we will do these checks then. */
- ;
- else if (permerror (loc, "invalid conversion from %qT to %qT",
- TREE_TYPE (expr), totype)
- && fn)
+ if (permerror (loc, "invalid conversion from %qT to %qT",
+ TREE_TYPE (expr), totype)
+ && fn)
inform (DECL_SOURCE_LOCATION (fn),
"initializing argument %P of %qD", argnum, fn);
@@ -6515,9 +6507,12 @@ convert_for_arg_passing (tree type, tree val, tsubst_flags_t complain)
which no conversions at all should be done. This is true for some
builtins which don't act like normal functions. */
-static bool
+bool
magic_varargs_p (tree fn)
{
+ if (flag_enable_cilkplus && is_cilkplus_reduce_builtin (fn) != BUILT_IN_NONE)
+ return true;
+
if (DECL_BUILT_IN (fn))
switch (DECL_FUNCTION_CODE (fn))
{
@@ -6895,21 +6890,13 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
" (you can disable this with -fno-deduce-init-list)");
}
}
+ val = convert_like_with_context (conv, arg, fn, i - is_method,
+ conversion_warning
+ ? complain
+ : complain & (~tf_warning));
- /* If the function call is builtin array notation function then no need
- to do any type conversion. */
- if (flag_enable_cilkplus
- && is_cilkplus_reduce_builtin (fn) != BUILT_IN_NONE)
- val = arg;
- else
- {
- val = convert_like_with_context (conv, arg, fn, i - is_method,
- conversion_warning
- ? complain
- : complain & (~tf_warning));
-
- val = convert_for_arg_passing (type, val, complain);
- }
+ val = convert_for_arg_passing (type, val, complain);
+
if (val == error_mark_node)
return error_mark_node;
else