http://d.puremagic.com/issues/show_bug.cgi?id=3500

           Summary: Program behaves differently with -inline
           Product: D
           Version: 2.035
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: nfx...@gmail.com


--- Comment #0 from nfx...@gmail.com 2009-11-12 10:20:47 PST ---
The following program behaves differently whether you pass -inline to dmd or
not.
The correct output is "A::x()", but with -inline, it outputs "B::x()".
Conclusion: the dmd inliner must be buggy.
I confirmed this with:
- dmd 1.051/Tango
- dmd 2.035/Phobos

Command line, failing binary: dmd bug.d -inline
Correct binary: dmd bug.d

Test using Tango:

import tango.util.log.Trace;

class A {
    void x() {
        Trace.formatln("A::x()");
    }
}

class B : A {
    override void x() {
        Trace.formatln("B::x()");
    }

    private void do_x() {
        super.x();
    }
}

void main() {
    B b = new B();
    b.do_x();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to