summaryrefslogtreecommitdiff
path: root/gcc/cp/name-lookup.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-20 00:18:24 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-20 00:18:24 +0000
commit7ef1439905f453c183dc9ddeac220371a1a2cfc1 (patch)
treef2fd9f01f614185daf70c05007cdcde2929152b5 /gcc/cp/name-lookup.c
parentb70bdf1f012f2c0837b4d5f17888a27278ad9939 (diff)
downloadgcc-7ef1439905f453c183dc9ddeac220371a1a2cfc1.tar.gz
* call.c (build_op_delete_call): Do not forget the placement
arguments when iterating through mutiple delete operators. * cp-tree.h (svaed_scope): Remove last_parms. (NEW_DELETE_OPNAME_P): New macro. (last_function_parms): Remove. (do_friend): Adjust prototype. * decl.c (grokparms): Return the PARM_DECLs directly, rather than using last_function_parms. (grokfndecl): Take the PARM_DECLs as an argument, rather than using last_function_parms. (grokdeclarator): Adjust accordingly. Do not form METHOD_TYPEs for class-specific operator new and operator delete. (grok_op_properties): Do not look for allocation functions with METHOD_TYPEs. (start_function): Use DECL_ARGUMENTS instead of last_function_parms. * decl.h (last_function_parms): Do not declare. * decl2.c (grokclassfn): Do not use last_function_parms. * friend.c (do_friend): Remove parmdecls parameter. * name-lookup.c (push_to_top_level): Do not save last_function_parms. (pop_from_top_level): Do not restore it. * pt.c (check_explicit_specialization): Do not adjust last_function_parms. * name-lookup.c (do_local_using_decl): Create a local binding for types brought in via using declarations. * name-lookup.c (lookup_arg_dependent): Handle block-scope function declarations correctly. * semantics.c (finish_id_expression): Correct handling of conversion operators to dependent types. * typeck.c (lookup_destructor): Allow the use of destructors from base classes. * g++.dg/init/placement3.C: New test. * g++.dg/template/spec13.C: New test. * g++.dg/lookup/using11.C: New test. * g++.dg/lookup/koenig3.C: New test. * g++.dg/template/operator2.C: New test. * g++.dg/expr/dtor3.C: New test. * g++.old-deja/g++.brendan/crash15.C: Remove incorrect dg-error marker. * g++.old-deja/g++.law/visibility28.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79722 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r--gcc/cp/name-lookup.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index e0a919d5b55..a23574248f7 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -2272,7 +2272,10 @@ do_local_using_decl (tree decl, tree scope, tree name)
push_local_binding (name, newval, PUSH_USING);
}
if (newtype)
- set_identifier_type_value (name, newtype);
+ {
+ push_local_binding (name, newtype, PUSH_USING);
+ set_identifier_type_value (name, newtype);
+ }
/* Emit debug info. */
if (!processing_template_decl)
@@ -4474,11 +4477,15 @@ lookup_arg_dependent (tree name, tree fns, tree args)
we found were brought into the current namespace via a using
declaration, we have not really checked the namespace from which
they came. Therefore, we check all namespaces here -- unless the
- function we have is from the current namespace. */
+ function we have is from the current namespace. Even then, we
+ must check all namespaces if the function is a local
+ declaration; any other declarations present at namespace scope
+ should be visible during argument-dependent lookup. */
if (fns)
fn = OVL_CURRENT (fns);
if (fn && TREE_CODE (fn) == FUNCTION_DECL
- && CP_DECL_CONTEXT (fn) != current_decl_namespace ())
+ && (CP_DECL_CONTEXT (fn) != current_decl_namespace ()
+ || DECL_LOCAL_FUNCTION_P (fn)))
k.namespaces = NULL_TREE;
else
/* Setting NAMESPACES is purely an optimization; it prevents
@@ -4835,7 +4842,6 @@ push_to_top_level (void)
s->bindings = b;
s->need_pop_function_context = need_pop;
s->function_decl = current_function_decl;
- s->last_parms = last_function_parms;
scope_chain = s;
current_function_decl = NULL_TREE;
@@ -4873,7 +4879,6 @@ pop_from_top_level (void)
if (s->need_pop_function_context)
pop_function_context_from (NULL_TREE);
current_function_decl = s->function_decl;
- last_function_parms = s->last_parms;
timevar_pop (TV_NAME_LOOKUP);
}