This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix for java/2605
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH] Fix for java/2605
- From: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Date: Fri, 1 Jun 2001 23:07:16 -0700
- Reply-to: apbianco at cygnus dot com
This fixes java/2605 and doesn't cause any regression. I'm going to
check this in the trunk and the branch.
./A
2001-06-01 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (type_literals:): Use `build_incomplete_class_ref' with
builtin type.
(patch_incomplete_class_ref): Build the class ref, build the class
init if necessary, complete the tree.
Fixes PR java/2605
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.251.2.29
diff -u -p -r1.251.2.29 parse.y
--- parse.y 2001/05/31 23:39:50 1.251.2.29
+++ parse.y 2001/06/02 03:09:34
@@ -1954,9 +1954,12 @@ type_literals:
| array_type DOT_TK CLASS_TK
{ $$ = build_incomplete_class_ref ($2.location, $1); }
| primitive_type DOT_TK CLASS_TK
- { $$ = build_class_ref ($1); }
+ { $$ = build_incomplete_class_ref ($2.location, $1); }
| VOID_TK DOT_TK CLASS_TK
- { $$ = build_class_ref (void_type_node); }
+ {
+ $$ = build_incomplete_class_ref ($2.location,
+ void_type_node);
+ }
;
class_instance_creation_expression:
@@ -13778,8 +13781,11 @@ patch_incomplete_class_ref (node)
if (!flag_emit_class_files || JPRIMITIVE_TYPE_P (ref_type))
{
+ tree dot = build_class_ref (ref_type);
/* A class referenced by `foo.class' is initialized. */
- return build_class_init (ref_type, build_class_ref (ref_type));
+ if (!flag_emit_class_files)
+ dot = build_class_init (ref_type, dot);
+ return java_complete_tree (dot);
}
/* If we're emitting class files and we have to deal with non