diff options
author | Jason Merrill <jason@redhat.com> | 2003-12-08 18:15:30 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2003-12-08 18:15:30 -0500 |
commit | 3c28fc742591b42850bd8422a85e73621a6ec5e3 (patch) | |
tree | 8695b2300a9ac19f099cd8b376cdf41864b90b9e /gcc | |
parent | 1616b0d5f93a326e8b692f5cc09a097c79e8844f (diff) | |
download | gcc-3c28fc742591b42850bd8422a85e73621a6ec5e3.zip gcc-3c28fc742591b42850bd8422a85e73621a6ec5e3.tar.gz gcc-3c28fc742591b42850bd8422a85e73621a6ec5e3.tar.bz2 |
name-lookup.c, [...]: Revert Giovanni's patch from yesterday.
* name-lookup.c, init.c, except.c: Revert Giovanni's patch from
yesterday.
From-SVN: r74446
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/except.c | 5 | ||||
-rw-r--r-- | gcc/cp/init.c | 17 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 13 |
4 files changed, 11 insertions, 27 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3fa1392..63c8ce77 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2003-12-08 Jason Merrill <jason@redhat.com> + * name-lookup.c, init.c, except.c: Revert Giovanni's patch from + yesterday. + Give the anonymous namespace a null DECL_NAME. * cp-tree.h: Don't declare anonymous_namespace_name. * decl.c: Don't define it. diff --git a/gcc/cp/except.c b/gcc/cp/except.c index b684efb..1d4e766 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -645,11 +645,6 @@ build_throw (tree exp) tmp = build_function_type (ptr_type_node, tmp); fn = push_throw_library_fn (fn, tmp); } - else if (really_overloaded_fn (fn)) - {
- error ("`%D' should never be overloaded", fn); - return error_mark_node;
- } fn = OVL_CURRENT (fn); exp = build_function_call (fn, tree_cons (NULL_TREE, exp, NULL_TREE)); } diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 19642d6..21b0032 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2005,18 +2005,11 @@ build_new_1 (tree exp) tree class_size = size_in_bytes (true_type); static const char alloc_name[] = "_Jv_AllocObject"; use_java_new = 1; - if (!get_global_value_if_present (get_identifier (alloc_name), - &alloc_decl)) - {
- error ("call to Java constructor with `%s' undefined", alloc_name); - return error_mark_node; - } - else if (really_overloaded_fn (alloc_decl)) - {
- error ("`%D' should never be overloaded", alloc_decl); - return error_mark_node; - } - alloc_decl = OVL_CURRENT (alloc_decl); + alloc_decl = IDENTIFIER_GLOBAL_VALUE (get_identifier (alloc_name)); + if (alloc_decl == NULL_TREE) + fatal_error ("call to Java constructor with `%s' undefined", + alloc_name); + class_addr = build1 (ADDR_EXPR, jclass_node, class_decl); alloc_call = (build_function_call (alloc_decl, diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 7446b30..ec8a634 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -2006,11 +2006,7 @@ push_overloaded_decl (tree decl, int flags) } } - /* FIXME: We should build OVERLOADs for all function declarations here. - But right now, there are too many places where the code creates an - artificial declaration and expects the name to be bound exactly - to a FUNCTION_DECL. */ - if (!DECL_ARTIFICIAL (decl)) + if (old || TREE_CODE (decl) == TEMPLATE_DECL) { if (old && TREE_CODE (old) != OVERLOAD) new_binding = ovl_cons (decl, ovl_cons (old, NULL_TREE)); @@ -2020,6 +2016,7 @@ push_overloaded_decl (tree decl, int flags) OVL_USED (new_binding) = 1; } else + /* NAME is not ambiguous. */ new_binding = decl; if (doing_global) @@ -2877,11 +2874,7 @@ set_namespace_binding (tree name, tree scope, tree val) if (scope == NULL_TREE) scope = global_namespace; b = binding_for_name (NAMESPACE_LEVEL (scope), name); - if (!b->value - /* If OVL_CHAIN is NULL, it's the first FUNCTION_DECL for this name, - and we still need to call supplement_binding. */ - || (TREE_CODE (val) == OVERLOAD && OVL_CHAIN (val)) - || val == error_mark_node) + if (!b->value || TREE_CODE (val) == OVERLOAD || val == error_mark_node) b->value = val; else supplement_binding (b, val); |