diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-11-23 21:49:02 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2007-11-23 21:49:02 +0100 |
commit | 360f866c16da467d7851b72b3d9c6c3fd1653721 (patch) | |
tree | 025c9ee6f18eef0c2f493c4725f5fb7431ae2dd6 /gcc/cp/init.c | |
parent | 6ca39fcbf6eb51d39d84916a4c742e20bb2c91e0 (diff) | |
download | gcc-360f866c16da467d7851b72b3d9c6c3fd1653721.zip gcc-360f866c16da467d7851b72b3d9c6c3fd1653721.tar.gz gcc-360f866c16da467d7851b72b3d9c6c3fd1653721.tar.bz2 |
re PR c++/30293 (ICE with extern "Java" in store_init_value)
PR c++/30293
PR c++/30294
* decl.c (cp_finish_decl): Disallow variable or field
definitions if extern "Java" aggregates.
(grokparms): Disallow parameters with extern "Java"
aggregates.
(check_function_type): Disallow function return values
with extern "Java" aggregates.
* init.c (build_new_1): Disallow placement new with
extern "Java" aggregates.
* g++.dg/ext/java-2.C: New test.
From-SVN: r130382
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r-- | gcc/cp/init.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c index c5c17b1..202f3b6 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1786,6 +1786,11 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, (alloc_fn, build_tree_list (NULL_TREE, class_addr))); } + else if (TYPE_FOR_JAVA (elt_type)) + { + error ("Java class %q#T object allocated using placement new", elt_type); + return error_mark_node; + } else { tree fnname; |