https://issues.dlang.org/show_bug.cgi?id=20360
Issue ID: 20360
Summary: std.variant doesn't do postblit/dtor correctly for
large structs
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P1
Component: phobos
Assignee: [email protected]
Reporter: [email protected]
unittest
{
import std.variant;
static struct S
{
int* p;
ubyte[100] u;
this(int a)
{
p = new int(a);
}
this(this)
{
p = new int(*p);
}
~this()
{
p = null;
}
}
Variant v = S(4);
assert(v.peek!S.p !is null); // fails
}
--