arrays: Fix static array of non-pod structs

This commit is contained in:
David Nadlinger 2015-07-27 20:15:44 +02:00
parent 5bdf482b8a
commit b5e9e556d5

View file

@ -251,8 +251,11 @@ void DtoArrayAssign(Loc& loc, DValue* lhs, DValue* rhs, int op, bool canSkipPost
return;
}
// TOKblit is generated by the frontend for (default) initialization of
// static arrays of structs with a single element.
const bool isConstructing = (op == TOKconstruct || op == TOKblit);
Type* const elemType = t->nextOf()->toBasetype();
const bool isConstructing = (op == TOKconstruct); // TODO: TOKblit?
const bool needsDestruction = (!isConstructing && elemType->needsDestruction());
const bool needsPostblit = (!canSkipPostblit && arrayNeedsPostblit(t));