aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 45b984e..5ccf3b8 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -9105,12 +9105,14 @@ maybe_warn_class_memaccess (location_t loc, tree fndecl,
}
/* Build and return a call to FN, using NARGS arguments in ARGARRAY.
+ If FN is the result of resolving an overloaded target built-in,
+ ORIG_FNDECL is the original function decl, otherwise it is null.
This function performs no overload resolution, conversion, or other
high-level operations. */
tree
build_cxx_call (tree fn, int nargs, tree *argarray,
- tsubst_flags_t complain)
+ tsubst_flags_t complain, tree orig_fndecl)
{
tree fndecl;
@@ -9120,11 +9122,13 @@ build_cxx_call (tree fn, int nargs, tree *argarray,
SET_EXPR_LOCATION (fn, loc);
fndecl = get_callee_fndecl (fn);
+ if (!orig_fndecl)
+ orig_fndecl = fndecl;
/* Check that arguments to builtin functions match the expectations. */
if (fndecl
&& !processing_template_decl
- && fndecl_built_in_p (fndecl, BUILT_IN_NORMAL))
+ && fndecl_built_in_p (fndecl))
{
int i;
@@ -9134,7 +9138,7 @@ build_cxx_call (tree fn, int nargs, tree *argarray,
argarray[i] = maybe_constant_value (argarray[i]);
if (!check_builtin_function_arguments (EXPR_LOCATION (fn), vNULL, fndecl,
- nargs, argarray))
+ orig_fndecl, nargs, argarray))
return error_mark_node;
}