aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
authorBryce McKinlay <mckinlay@redhat.com>2004-06-27 15:30:06 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2004-06-27 16:30:06 +0100
commit0f6cd83f96821808017f3b2318da521a9c29ed62 (patch)
tree011e3f2b332966ef19bafd54bb8b7f8351779679 /gcc/java/parse.y
parent64b663f8bd8abd190e9f2f2aa47dddf60769b8e3 (diff)
downloadgcc-0f6cd83f96821808017f3b2318da521a9c29ed62.zip
gcc-0f6cd83f96821808017f3b2318da521a9c29ed62.tar.gz
gcc-0f6cd83f96821808017f3b2318da521a9c29ed62.tar.bz2
re PR java/15715 (member interfaces are always static)
2004-06-26 Bryce McKinlay <mckinlay@redhat.com> PR java/15715. * parse.y (create_interface): Set correct access modifiers for interfaces. * jcf-write.c (get_classfile_modifiers): New function. (generate_classfile): Use get_classfile_modifiers, not get_access_flags. 2004-06-26 Bryce McKinlay <mckinlay@redhat.com> * parse.y (register_incomplete_type): Set JDEP_ENCLOSING for "super" dependency to current parser context, not NULL_TREE, for top-level classes. (jdep_resolve_class): Enable member access check for all inner class dependencies. From-SVN: r83734
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index e4ad4cd..4d7f218 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -3852,6 +3852,13 @@ create_interface (int flags, tree id, tree super)
/* Create a new decl if DECL is NULL, otherwise fix it */
decl = maybe_create_class_interface_decl (decl, raw_name, q_name, id);
+ /* Interfaces are always abstract. */
+ flags |= ACC_ABSTRACT;
+
+ /* Inner interfaces are always static. */
+ if (INNER_CLASS_DECL_P (decl))
+ flags |= ACC_STATIC;
+
/* Set super info and mark the class a complete */
set_super_info (ACC_INTERFACE | flags, TREE_TYPE (decl),
object_type_node, ctxp->interface_number);
@@ -5187,12 +5194,9 @@ register_incomplete_type (int kind, tree wfl, tree decl, tree ptr)
JDEP_MISC (new) = NULL_TREE;
/* For some dependencies, set the enclosing class of the current
class to be the enclosing context */
- if ((kind == JDEP_INTERFACE || kind == JDEP_ANONYMOUS)
+ if ((kind == JDEP_INTERFACE || kind == JDEP_ANONYMOUS || kind == JDEP_SUPER)
&& GET_ENCLOSING_CPC ())
JDEP_ENCLOSING (new) = TREE_VALUE (GET_ENCLOSING_CPC ());
- else if (kind == JDEP_SUPER)
- JDEP_ENCLOSING (new) = (GET_ENCLOSING_CPC () ?
- TREE_VALUE (GET_ENCLOSING_CPC ()) : NULL_TREE);
else
JDEP_ENCLOSING (new) = GET_CPC ();
JDEP_GET_PATCH (new) = (tree *)NULL;
@@ -5512,7 +5516,7 @@ jdep_resolve_class (jdep *dep)
if (!decl)
complete_class_report_errors (dep);
- else if (PURE_INNER_CLASS_DECL_P (decl))
+ else if (INNER_CLASS_DECL_P (decl))
{
tree inner = TREE_TYPE (decl);
if (! CLASS_LOADED_P (inner))