[Issue 11467] New: [CTFE] Overlapping array copy is allowed in CT

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 7 07:37:55 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11467

           Summary: [CTFE] Overlapping array copy is allowed in CT
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid, CTFE
          Severity: normal
          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> 2013-11-07 18:37:54 MSK ---
Overlapping array copy is allowed (and works fine for now) during CTFE:
---
static assert({
    auto a = [0, 1, 2, 3, 4];
    a[0 .. 4] = a[1 .. 5];
    assert(a == [1, 2, 3, 4, 4]);

    a = [0, 1, 2, 3, 4];
    a[1 .. 5] = a[0 .. 4];
    assert(a == [0, 0, 1, 2, 3]);
    return 1;
}());
---

But it is inconsistent with runtime behaviour when exception is thrown in such
case. I'd say it should be disallowed in CTFE too.

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


More information about the Digitalmars-d-bugs mailing list