]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re GNATS gcj/373: (interface inner classes are implicitly static)
authorBryce McKinlay <bryce@albatross.co.nz>
Mon, 18 Dec 2000 21:23:02 +0000 (21:23 +0000)
committerBryce McKinlay <bryce@gcc.gnu.org>
Mon, 18 Dec 2000 21:23:02 +0000 (21:23 +0000)
Fix for PR gcj/373:
* parse.y (create_class): Set ACC_STATIC if class is declared in an
interface.

From-SVN: r38365

gcc/java/ChangeLog
gcc/java/parse.y

index 0f71e7f8e1864a8838a01c26d0a4d1dc713be94c..42a82bf9333b85cea55607abd76dcb06799b539d 100644 (file)
@@ -6,6 +6,10 @@
        * class.c (layout_class): Call maybe_layout_super_class on 
        superinterfaces also, but only if compiling from bytecode.
 
+       Fix for PR gcj/373:
+       * parse.y (create_class): Set ACC_STATIC if class is declared in an
+       interface.
+
 2000-12-15  Tom Tromey  <tromey@redhat.com>
 
        * jcf-parse.c (jcf_parse_source): Set wfl_operator if not already
index ec09a49de2c667992574eecc01f742a24e21e670..1dc60163b8a4f32655184d2885e5d644408cf79e 100644 (file)
@@ -3887,7 +3887,14 @@ create_class (flags, id, super, interfaces)
   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;