Bug 10637 – minimallyInitializedArray: postblit on non-initialized...
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-14T02:44:00Z
Last change time
2014-02-14T08:04:30Z
Assigned to
monarchdodra
Creator
monarchdodra
Comments
Comment #0 by monarchdodra — 2013-07-14T02:44:54Z
...which can trigger faults in destructor.
No construction should occur at all in minimallyInitializedArray anyways.
//----
static struct S
{
static struct I{int i; alias i this;}
int* p;
this() @disable;
this(int i)
{
p = &(new I(i)).i;
}
this(this)
{
p = &(new I(*p)).i; //HERE
}
~this()
{
assert(p != null); //THERE
}
}
auto a = minimallyInitializedArray!(S[])(1);
//----
The above should work. It currently cores at HERE. Skipping HERE makes it assert at THERE.