aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index e8240e8..ac678d5 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1833,8 +1833,16 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p)
? LOOKUP_NONVIRTUAL : 0));
}
else if (is_overloaded_fn (fn))
- /* A call to a namespace-scope function. */
- result = build_new_function_call (fn, args);
+ {
+ /* If the function is an overloaded builtin, resolve it. */
+ if (TREE_CODE (fn) == FUNCTION_DECL
+ && DECL_BUILT_IN_CLASS (fn) == BUILT_IN_NORMAL)
+ result = resolve_overloaded_builtin (fn, args);
+
+ if (!result)
+ /* A call to a namespace-scope function. */
+ result = build_new_function_call (fn, args);
+ }
else if (TREE_CODE (fn) == PSEUDO_DTOR_EXPR)
{
if (args)
@@ -1851,6 +1859,7 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p)
have an overloaded `operator ()'. */
result = build_new_op (CALL_EXPR, LOOKUP_NORMAL, fn, args, NULL_TREE,
/*overloaded_p=*/NULL);
+
if (!result)
/* A call where the function is unknown. */
result = build_function_call (fn, args);