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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 82355c29..b698386 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -2812,7 +2812,10 @@ build_operator_new_call (tree fnname, tree args, tree *size, tree *cookie_size)
if (args == error_mark_node)
return args;
+ /* A global operator new must be looked up only at global scope. */
+ push_to_top_level();
fns = lookup_function_nonclass (fnname, args);
+ pop_from_top_level();
/* Figure out what function is being called. */
cand = perform_overload_resolution (fns, args, &candidates, &any_viable_p);