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]
Other format: [Raw text]

[Bug java/20659] New: gcj: Can't reference 'this' before the superclass constructor


gcc version 4.0.0 20041213

javac Bla.java works.
gcj -C Bla.java   (or -c)

Bla.java: In class 'Bla$B':
Bla.java: In constructor '(Bla)':
Bla.java:18: error: Can't reference 'this' before the superclass constructor 
has been called.
         super(doit());
               ^
1 error


------------------------------

public class Bla {

  protected int doit() {
    return 1;
  }

  public class A {
    public A(int i) {
    }
  }

  public class B extends A {
    public B() {
      super(doit());
    }
  }
}

-- 
           Summary: gcj: Can't reference 'this' before the superclass
                    constructor
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ovidr at users dot sourceforge dot net
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


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


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