aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPer Bothner <bothner@gcc.gnu.org>1998-08-20 09:44:01 -0700
committerPer Bothner <bothner@gcc.gnu.org>1998-08-20 09:44:01 -0700
commit824f42abafb7f57ac2c25f329640b58eacbd7370 (patch)
treee9958d1dffda7ecf64ebef1ddf9f812af983e302 /gcc
parentf668f16016466557738402723df012f81a588ae7 (diff)
downloadgcc-824f42abafb7f57ac2c25f329640b58eacbd7370.zip
gcc-824f42abafb7f57ac2c25f329640b58eacbd7370.tar.gz
gcc-824f42abafb7f57ac2c25f329640b58eacbd7370.tar.bz2
Handle new'ing of Java classes.
Handle new'ing of Java classes. * init.c (build_class_classref): New function. (build_new_1): If type is TYPE_FOR_JAVA: Call _Jv_AllocObject; constructor does not return this; don't need to exception-protect. * pt.c (lookup_template_class): Copy TYPE_FOR_JAVA flag. * decl2.c (acceptable_java_type): Handle template-derived types. From-SVN: r21881
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/decl2.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index c0b12e5..8e1d0c7 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1403,8 +1403,22 @@ acceptable_java_type (type)
type = TREE_TYPE (type);
if (TREE_CODE (type) == RECORD_TYPE)
{
- complete_type (type);
- return TYPE_FOR_JAVA (type);
+ tree args; int i;
+ if (! TYPE_FOR_JAVA (type))
+ return 0;
+ if (! CLASSTYPE_TEMPLATE_INFO (type))
+ return 1;
+ args = CLASSTYPE_TI_ARGS (type);
+ i = TREE_VEC_LENGTH (args);
+ while (--i >= 0)
+ {
+ type = TREE_VEC_ELT (args, i);
+ if (TREE_CODE (type) == POINTER_TYPE)
+ type = TREE_TYPE (type);
+ if (! TYPE_FOR_JAVA (type))
+ return 0;
+ }
+ return 1;
}
}
return 0;