[Issue 14046] New: Overlapping dynamic array copy is allowed if struct contains postblit
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Jan 26 01:20:53 PST 2015
https://issues.dlang.org/show_bug.cgi?id=14046
Issue ID: 14046
Summary: Overlapping dynamic array copy is allowed if struct
contains postblit
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: wrong-code
Severity: normal
Priority: P1
Component: druntime
Assignee: nobody at puremagic.com
Reporter: verylonglogin.reg at gmail.com
Overlapping dynamic array copy is now correctly disallowed in CTFE too (Issue
11467) but in runtime this one remaining case is allowed.
This code should throw `object.Error` in runtime but doesn't:
---
struct S { this(this) { } }
void main()
{
S[1] a;
a[0 .. 1] = a[0 .. 1];
}
---
--
More information about the Digitalmars-d-bugs
mailing list