aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>2006-06-23 15:59:51 +0000
committerVolker Reichelt <reichelt@gcc.gnu.org>2006-06-23 15:59:51 +0000
commita3d536f1c1c0aa3d414c17c4acc44c900b1f1e38 (patch)
tree834611c09e87709f52ba63aed4621e8b5f75bb29 /gcc/cp
parent6de5f432f1e671c985b02a29bea02eb15e7553cc (diff)
downloadgcc-a3d536f1c1c0aa3d414c17c4acc44c900b1f1e38.zip
gcc-a3d536f1c1c0aa3d414c17c4acc44c900b1f1e38.tar.gz
gcc-a3d536f1c1c0aa3d414c17c4acc44c900b1f1e38.tar.bz2
re PR c++/11468 (Deriving from CNI class java::lang::Object causing an ICE)
PR c++/11468 * init.c (build_new_1): Handle error_mark_nodes returned by build_java_class_ref. (build_java_class_ref): Do not abort compilation, but return error_mark_node. Improve error message. Fix indentation. * g++.dg/other/java2.C: New test. From-SVN: r114937
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/init.c16
2 files changed, 20 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 30c66d3..2f726bd 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2006-06-23 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/11468
+ * init.c (build_new_1): Handle error_mark_nodes returned by
+ build_java_class_ref.
+ (build_java_class_ref): Do not abort compilation, but return
+ error_mark_node. Improve error message. Fix indentation.
+
2006-06-23 Danny Smith <dannysmith@users.sourceforge.net>
PR target/27789
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 357cba9..c785308 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1696,6 +1696,9 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
tree class_decl = build_java_class_ref (elt_type);
static const char alloc_name[] = "_Jv_AllocObject";
+ if (class_decl == error_mark_node)
+ return error_mark_node;
+
use_java_new = 1;
if (!get_global_value_if_present (get_identifier (alloc_name),
&alloc_fn))
@@ -2148,8 +2151,10 @@ build_java_class_ref (tree type)
{
jclass_node = IDENTIFIER_GLOBAL_VALUE (get_identifier ("jclass"));
if (jclass_node == NULL_TREE)
- fatal_error ("call to Java constructor, while %<jclass%> undefined");
-
+ {
+ error ("call to Java constructor, while %<jclass%> undefined");
+ return error_mark_node;
+ }
jclass_node = TREE_TYPE (jclass_node);
}
@@ -2164,8 +2169,11 @@ build_java_class_ref (tree type)
break;
}
if (!field)
- internal_error ("can't find class$");
- }
+ {
+ error ("can't find %<class$%> in %qT", type);
+ return error_mark_node;
+ }
+ }
class_decl = IDENTIFIER_GLOBAL_VALUE (name);
if (class_decl == NULL_TREE)