Bug 11467 – [CTFE] Overlapping array copy is allowed in CT

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-07T07:37:00Z
Last change time
2015-01-26T04:51:45Z
Keywords
accepts-invalid, CTFE, pull
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2013-11-07T07:37:54Z
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.
Comment #1 by k.hara.pg — 2015-01-24T21:36:18Z
Comment #2 by github-bugzilla — 2015-01-26T04:51:44Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a83ed2534f51c720f2298f68e10b998250a3ecf9 fix Issue 11467 - [CTFE] Overlapping array copy is allowed in CT