diff options
author | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2003-12-09 17:49:28 +0000 |
---|---|---|
committer | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2003-12-09 17:49:28 +0000 |
commit | 6961a592b3ae5f34f1d4f7b96ca44bf7732cf8b2 (patch) | |
tree | 4589e4bd8dfcb605d1f0a067e711a9049cba2032 /gcc | |
parent | 6975bd2cc4160b96ed664345d06e1cadcc590779 (diff) | |
download | gcc-6961a592b3ae5f34f1d4f7b96ca44bf7732cf8b2.zip gcc-6961a592b3ae5f34f1d4f7b96ca44bf7732cf8b2.tar.gz gcc-6961a592b3ae5f34f1d4f7b96ca44bf7732cf8b2.tar.bz2 |
init.c (build_new_1): Deal with an OVERLOAD set when looking up for _Jv_AllocObject.
* init.c (build_new_1): Deal with an OVERLOAD set when
looking up for _Jv_AllocObject.
* except.c (build_throw): Likewise for _Jv_Throw.
From-SVN: r74474
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/except.c | 5 | ||||
-rw-r--r-- | gcc/cp/init.c | 17 |
3 files changed, 23 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4b3b74a..7f23f0f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2003-12-09 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ * init.c (build_new_1): Deal with an OVERLOAD set when
+ looking up for _Jv_AllocObject.
+ * except.c (build_throw): Likewise for _Jv_Throw.
+ 2003-12-08 Jason Merrill <jason@redhat.com> PR c++/11971 diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 1d4e766..b684efb 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -645,6 +645,11 @@ 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 21b0032..19642d6 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2005,11 +2005,18 @@ build_new_1 (tree exp) tree class_size = size_in_bytes (true_type); static const char alloc_name[] = "_Jv_AllocObject"; use_java_new = 1; - 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); - + 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); class_addr = build1 (ADDR_EXPR, jclass_node, class_decl); alloc_call = (build_function_call (alloc_decl, |