When the testcase is compiled like this: $ gcj -o A --main=C A.java B.java C.java C.java: In class `C': C.java: In method `C.m()': C.java:5: error: Can't find method `m()' in type `B'. Candidates are: `B.m()' in `B' `A$A1.m()' in `A$A1'. super.m(); ^ 1 error We get the error shown above. However with Sun's javac: $ javac -g A.java B.java C.java No errors are obtained. I will attach the three files A.java B.java and C.java
Created attachment 8499 [details] Testcase part1
Created attachment 8500 [details] Testcase part2
Created attachment 8501 [details] Testcase part3
I should add that I think this is a target independent bug as it also fails for a mipsel-linux target.
If you modify the testcase file A.java so that the inner class A1 is no longer static, the testcase converts to an ice-on-invalid-code.
Created attachment 8502 [details] First part of smaller testcase.
Created attachment 8503 [details] Second part of smaller testcase. New Testcase. I think it is the same problem. $ gcj A1.java B1.java B1.java: In class `B1': B1.java: In method `B1.n()': B1.java:10: error: Can't find method `m()' in type `B1'. Candidates are: `B1.m()' in `B1' `A1$A2.m()' in `A1$A2'. m(); ^ 1 error
Confirmed, I think this is a dup of bug 18119.
I'm testing a fix. This is a different problem to 18131.
Err, 18119 I mean.
*** Bug 22060 has been marked as a duplicate of this bug. ***
Subject: Bug 20697 CVSROOT: /cvs/gcc Module name: gcc Changes by: bryce@gcc.gnu.org 2005-06-23 15:01:05 Modified files: gcc/java : ChangeLog parse.y libjava : ChangeLog Added files: libjava/testsuite/libjava.compile: PR20697.java Log message: PR java/20697 * parse.y (find_most_specific_methods_list): Remove special case for inner classes. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1630&r2=1.1631 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&r1=1.539&r2=1.540 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.compile/PR20697.java.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3673&r2=1.3674
Fix checked in.