Java: Fix for PR 4695

Alexandre Petit-Bianco apbianco@cygnus.com
Tue Nov 6 14:03:00 GMT 2001


Bryce McKinlay writes:

> So, this is a different bug, which happens to be revealed by my patch ;-)

How about adding this hunk to your patch? This corrected the regression.

./A

Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.323
diff -u -p -r1.323 parse.y
--- parse.y     2001/10/26 01:53:56     1.323
+++ parse.y     2001/11/06 20:30:44
@@ -10375,9 +10365,11 @@ patch_method_invocation (patch, primary,
     check_deprecation (wfl, list);
 
   /* If invoking a innerclass constructor, there are hidden parameters
-     to pass */
+     to pass, unless we're within an explicit constructor invocation
+     statement (JLS 8.8.5.1) */
   if (TREE_CODE (patch) == NEW_CLASS_EXPR 
-      && PURE_INNER_CLASS_TYPE_P (DECL_CONTEXT (list)))
+      && PURE_INNER_CLASS_TYPE_P (DECL_CONTEXT (list))
+      && ! ctxp->explicit_constructor_p)
     {
       /* And make sure we add the accessed local variables to be saved
         in field aliases. */



More information about the Gcc-patches mailing list