This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Java: Fix for PR 373


This patch fixes gcj/373:
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=373&database=java

ok to commit?

regards

  [ bryce ]


2000-12-16  Bryce McKinlay  <bryce@albatross.co.nz>

	* parse.y (create_class): Set ACC_STATIC if class is declared in an
	interface.

Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
retrieving revision 1.236
diff -u -r1.236 parse.y
--- parse.y	2000/12/15 08:50:09	1.236
+++ parse.y	2000/12/16 05:04:55
@@ -3887,7 +3887,14 @@
   else
     super_decl_type = NULL_TREE;
 
-  /* Set super info and mark the class a complete */
+  /* A class nested in an interface is implicitly static. */
+  if (INNER_CLASS_DECL_P (decl)
+      && CLASS_INTERFACE (TYPE_NAME (TREE_TYPE (DECL_CONTEXT (decl)))))
+    {
+      flags |= ACC_STATIC;
+    }
+
+  /* Set super info and mark the class as complete. */
   set_super_info (flags, TREE_TYPE (decl), super_decl_type, 
 		  ctxp->interface_number);
   ctxp->interface_number = 0;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]