re PR java/18697 (Miscompilation of GtkMenuItemPeer.setParent(MenuItem))
authorAndrew Haley <aph@redhat.com>
Fri, 3 Dec 2004 18:01:59 +0000 (18:01 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Fri, 3 Dec 2004 18:01:59 +0000 (18:01 +0000)
2004-12-03  Andrew Haley  <aph@redhat.com>

PR java/18697
* class.c (layout_class_method): Don't fail to override a method
simply because it has DECL_ARTIFICIAL set.

From-SVN: r91689

gcc/java/ChangeLog
gcc/java/class.c

index 4f4b8bd1aa691a67450360dff7db7c2ff2a35d4d..352177038094ac33cad4f3c461c7b1acb1651058 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-03  Andrew Haley  <aph@redhat.com>
+
+       PR java/18697 
+       * class.c (layout_class_method): Don't fail to override a method
+       simply because it has DECL_ARTIFICIAL set.
+
 2004-12-02  Tom Tromey  <tromey@redhat.com>
 
        PR java/16675:
index 2af0134fb89fefb0caf78523617724514e09151a..c314950cf44e33e52e2541e2f0343ebbc4847684 100644 (file)
@@ -2338,8 +2338,7 @@ layout_class_method (tree this_class, tree super_class,
       tree super_method = lookup_argument_method (super_class, method_name,
                                                  method_sig);
       if (super_method != NULL_TREE
-         && ! METHOD_DUMMY (super_method)
-         && ! DECL_ARTIFICIAL (super_method))
+         && ! METHOD_DUMMY (super_method))
         {
          method_override = true;
          if (! METHOD_PUBLIC (super_method) && 
@@ -2358,7 +2357,8 @@ layout_class_method (tree this_class, tree super_class,
          tree method_index = get_method_index (super_method);
          set_method_index (method_decl, method_index);
          if (method_index == NULL_TREE 
-             && !CLASS_FROM_SOURCE_P (this_class))
+             && !CLASS_FROM_SOURCE_P (this_class)
+             && ! DECL_ARTIFICIAL (super_method))
            error ("%Jnon-static method '%D' overrides static method",
                    method_decl, method_decl);
        }