]> gcc.gnu.org Git - gcc.git/commitdiff
Handle new'ing of Java classes.
authorPer Bothner <bothner@gcc.gnu.org>
Thu, 20 Aug 1998 16:44:01 +0000 (09:44 -0700)
committerPer Bothner <bothner@gcc.gnu.org>
Thu, 20 Aug 1998 16:44:01 +0000 (09:44 -0700)
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

gcc/cp/decl2.c

index c0b12e503045ad20e0b189b34f82192e0c20249c..8e1d0c791ed6aef96b9dc501b107f501526497f9 100644 (file)
@@ -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;
This page took 0.067221 seconds and 5 git commands to generate.