diff options
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r-- | gcc/cp/name-lookup.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index bd83695cd0a..3197a41077d 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -2032,6 +2032,14 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype, return; } + /* It is impossible to overload a built-in function; any explicit + declaration eliminates the built-in declaration. So, if OLDVAL + is a built-in, then we can just pretend it isn't there. */ + if (oldval + && TREE_CODE (oldval) == FUNCTION_DECL + && DECL_ANTICIPATED (oldval)) + oldval = NULL_TREE; + /* Check for using functions. */ if (decls.value && is_overloaded_fn (decls.value)) { @@ -2044,15 +2052,6 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype, oldval = NULL_TREE; } - /* It is impossible to overload a built-in function; any - explicit declaration eliminates the built-in declaration. - So, if OLDVAL is a built-in, then we can just pretend it - isn't there. */ - if (oldval - && TREE_CODE (oldval) == FUNCTION_DECL - && DECL_ANTICIPATED (oldval)) - oldval = NULL_TREE; - *newval = oldval; for (tmp = decls.value; tmp; tmp = OVL_NEXT (tmp)) { @@ -4699,8 +4698,7 @@ pushtag (tree name, tree type, tag_scope scope) way. (It's otherwise tricky to find a member function definition it's only pointed to from within a local class.) */ if (TYPE_CONTEXT (type) - && TREE_CODE (TYPE_CONTEXT (type)) == FUNCTION_DECL - && !processing_template_decl) + && TREE_CODE (TYPE_CONTEXT (type)) == FUNCTION_DECL) VEC_safe_push (tree, gc, local_classes, type); } if (b->kind == sk_class |