This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcj: Is this a bug?


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]