re PR java/20697 (Invalid Can't find method error on call to super)
authorBryce McKinlay <mckinlay@redhat.com>
Thu, 23 Jun 2005 15:00:50 +0000 (15:00 +0000)
committerBryce McKinlay <bryce@gcc.gnu.org>
Thu, 23 Jun 2005 15:00:50 +0000 (16:00 +0100)
PR java/20697
* parse.y (find_most_specific_methods_list): Remove special case for
inner classes.

From-SVN: r101270

gcc/java/ChangeLog
gcc/java/parse.y
libjava/ChangeLog
libjava/testsuite/libjava.compile/PR20697.java [new file with mode: 0644]

index b6f6e3a694d46374efa83144da6a84a698fdc7c4..4c967594797a399aee6675cea5f8b03cb9245dcf 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-23  Bryce McKinlay  <mckinlay@redhat.com>
+
+       PR java/20697
+       * parse.y (find_most_specific_methods_list): Remove special case for
+       inner classes.
+
 2005-06-15  Tom Tromey  <tromey@redhat.com>
 
        PR libgcj/21906:
index 11087192bec588e30fe91eb7a344b8612a549cfc..0c35911ed455e21479a86313262c812ab0f4aaf6 100644 (file)
@@ -11416,13 +11416,9 @@ find_most_specific_methods_list (tree list)
          if (argument_types_convertible (method_v, current_v))
            {
              if (valid_method_invocation_conversion_p
-                 (DECL_CONTEXT (method_v), DECL_CONTEXT (current_v))
-                 || (INNER_CLASS_TYPE_P (DECL_CONTEXT (current_v))
-                     && enclosing_context_p (DECL_CONTEXT (method_v),
-                                             DECL_CONTEXT (current_v))))
+                 (DECL_CONTEXT (method_v), DECL_CONTEXT (current_v)))
                {
-                 int v = (DECL_SPECIFIC_COUNT (current_v) +=
-                   (INNER_CLASS_TYPE_P (DECL_CONTEXT (current_v)) ? 2 : 1));
+                 int v = (DECL_SPECIFIC_COUNT (current_v) += 1);
                  max = (v > max ? v : max);
                }
            }
index c8532c7badb17b6bff890c755274fd47e780a15c..c81a79b0e894435861ee045a26c90f4beea144be 100644 (file)
@@ -1,3 +1,7 @@
+2005-06-23  Bryce McKinlay  <mckinlay@redhat.com>
+
+       * testsuite/libjava.compile/PR20697.java: New test-case.
+
 2005-06-22  Kelley Cook  <kcook@gcc.gnu.org>
 
        * Makefile.am (SUBDIRS): Use append for conditional.
diff --git a/libjava/testsuite/libjava.compile/PR20697.java b/libjava/testsuite/libjava.compile/PR20697.java
new file mode 100644 (file)
index 0000000..56efb1d
--- /dev/null
@@ -0,0 +1,29 @@
+public class PR20697
+{
+    public interface I
+    {
+        public void m();
+    }
+
+    public static class A2 implements I
+    {
+        public void m()
+        {
+            return;
+        }
+    }
+    
+}
+
+class Test extends PR20697.A2
+{
+    public void m()
+    {
+        return;
+    }
+
+    public void n()
+    {
+        m();
+    }
+}