[Issue 8539] New: -inline failure involving CTFE, nested functions, a ref parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 11 12:48:38 PDT 2012


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

           Summary: -inline failure involving CTFE, nested functions, a
                    ref parameter
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: mailme+d at nilsb.dyndns.org


--- Comment #0 from Nils <mailme+d at nilsb.dyndns.org> 2012-08-11 12:48:35 PDT ---
test.d:
---
int f() {
    static void one(ref int x) {
        x = 1;
    }
    static void go() {
        int y;
        one(y);
        assert(y == 1); // fails with -inline
    }
    go();
    return 0;
}
enum e = f();
---

$ dmd -c -o- test.d
$ dmd -c -o- -inline test.d
test.d(8): Error: assert(y == 1) failed
test.d(10):        called from here: go()
test.d(13):        called from here: f()

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


More information about the Digitalmars-d-bugs mailing list