OSDN Git Service

2005-08-10 Andrew Haley <aph@redhat.com>
[pf3gnuchains/gcc-fork.git] / gcc / java / parse.y
index 82c156e..363d074 100644 (file)
@@ -10945,7 +10945,8 @@ maybe_use_access_method (int is_super_init, tree *mdecl, tree *this_arg)
      invoking a static method. Note that if MD's type is unrelated to
      CURRENT_CLASS, then the current this can be used. */
 
-  if (non_static_context && DECL_CONTEXT (md) != object_type_node)
+  if (non_static_context 
+      && !inherits_from_p (current_class, DECL_CONTEXT (md)))
     {
       ctx = TREE_TYPE (DECL_CONTEXT (TYPE_NAME (current_class)));
       if (inherits_from_p (ctx, DECL_CONTEXT (md)))