diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2013-11-06 20:19:10 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2013-11-06 20:19:10 +0000 |
commit | 71b71b96f05daefae87b3f5b65b7252987fb6eab (patch) | |
tree | 457be5fd690d044c2c1f97d8d83eb0a97e7bb2ba /gcc/cp | |
parent | f038dae646bac2b31be98ab592c0e5206d2d96f5 (diff) | |
download | gcc-71b71b96f05daefae87b3f5b65b7252987fb6eab.zip gcc-71b71b96f05daefae87b3f5b65b7252987fb6eab.tar.gz gcc-71b71b96f05daefae87b3f5b65b7252987fb6eab.tar.bz2 |
re PR c++/11006 ([CNI] ICE with use of __java_boolean)
/cp
2013-11-06 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/11006
* init.c (build_new_1): Don't call build_java_class_ref on non-class
types.
/testsuite
2013-11-06 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/11006
* g++.dg/other/java3.C: New.
From-SVN: r204469
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/init.c | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 887ea615..6369f05 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2013-11-06 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/11006 + * init.c (build_new_1): Don't call build_java_class_ref on non-class + types. + 2013-11-05 Jason Merrill <jason@redhat.com> PR c++/58868 diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 85732ff..a4d8280 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2461,9 +2461,16 @@ build_new_1 (vec<tree, va_gc> **placement, tree type, tree nelts, if (vec_safe_is_empty (*placement) && TYPE_FOR_JAVA (elt_type)) { tree class_addr; - tree class_decl = build_java_class_ref (elt_type); + tree class_decl; static const char alloc_name[] = "_Jv_AllocObject"; + if (!MAYBE_CLASS_TYPE_P (elt_type)) + { + error ("%qT isn%'t a valid Java class type", elt_type); + return error_mark_node; + } + + class_decl = build_java_class_ref (elt_type); if (class_decl == error_mark_node) return error_mark_node; |