[Issue 9245] New: [CTFE] postblit not called on static array initialization

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 30 01:16:55 PST 2012


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

           Summary: [CTFE] postblit not called on static array
                    initialization
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: CTFE, wrong-code
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2012-12-30 12:16:52 MSK ---
---
void f()
{
    int postblits = 0;
    struct S
    {
        this(this) const
        { ++postblits; }
    }

    auto s = S();

    S[2] arr = s;
    assert(postblits == 2); // failed: S.postblits == 0
    postblits = 0;

    const S[2] constArr = s;
    assert(postblits == 2); // failed: S.postblits == 0
    postblits = 0;

    const S[2] constArr2 = arr;
    assert(postblits == 2); // failed: S.postblits == 0
    postblits = 0;
}
---

Also see same non-CTFE issue 8950.

-- 
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