diff options
| author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-12-18 21:23:02 +0000 |
|---|---|---|
| committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-12-18 21:23:02 +0000 |
| commit | 7e98fcefaa8d364e9452934e23fe3e1eefde02c1 (patch) | |
| tree | 7c06673c62808b74162f6559910809044b833d70 | |
| parent | 9cd3ae380afa395fd4b303e92a2c41b77cbe5cf8 (diff) | |
| download | ppe42-gcc-7e98fcefaa8d364e9452934e23fe3e1eefde02c1.tar.gz ppe42-gcc-7e98fcefaa8d364e9452934e23fe3e1eefde02c1.zip | |
Fix for PR gcj/373:
* parse.y (create_class): Set ACC_STATIC if class is declared in an
interface.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38365 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/java/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/java/parse.y | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 0f71e7f8e18..42a82bf9333 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -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 diff --git a/gcc/java/parse.y b/gcc/java/parse.y index ec09a49de2c..1dc60163b8a 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -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; |

