This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcj: Is this a bug?
- To: gcc-bugs at gcc dot gnu dot org
- Subject: gcj: Is this a bug?
- From: Martin Kahlert <martin dot kahlert at infineon dot com>
- Date: Fri, 5 Jan 2001 11:18:51 +0100
- Reply-To: martin dot kahlert at infineon dot com
Hi!
i came across a very strange construct:
public class priv
{
private class InnerPriv
{
private InnerPriv() { }
}
public void f()
{
InnerPriv ip = new InnerPriv();
}
public static void main(String[] args)
{
System.out.println( "Hello World" );
}
}
gcj says:
priv.java: In class `priv':
priv.java: In method `f()':
priv.java:10: Can't access private method `void priv$InnerPriv.priv(priv)' from `priv'.
InnerPriv ip = new InnerPriv();
^
1 error
Which seems reasonable to me, but javac compiles this without any warning.
(I tried SUN's javac and the Linux version)
Any comments?
Bye,
Martin.
--
The early bird gets the worm. If you want something else for
breakfast, get up later.