The following compiled with jikes outputs 42.
Compiled with gcj -C and ran with gij gives a java.lang.IllegalAccessError

public class A
{
  public static class B
  {
    private static int i = 42;
  }

  public static void main(String[] args)
  {
    System.out.println(B.i);
  }
}

-- 
           Summary: gcj -C compiled code accessing private fields of inner
                    classes from outer class give IllegalAccessError
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mark at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
OtherBugsDependingO 18131
             nThis:


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19870

Reply via email to