T emplace(T, Args...)(void[] chunk, Args args) if (is(T == class)) { enforce(chunk.length >= __traits(classInstanceSize, T), new ConvException("emplace: chunk size too small")); auto a = cast(size_t) chunk.ptr; enforce(a % T.alignof == 0, text(a, " vs. ", T.alignof)); ... } T.alignof is the alignment of the class reference, not the class instance. Classes have to be 16-byte aligned, but the enforcement checks only for 4 byte alignment. This results in segmentation faults in user code, even though the function performs checks.
https://github.com/D-Programming-Language/phobos/pull/249
The enforcement was actually correct, since apparently alignment of size_t.sizeof is enough.
(In reply to comment #2) > The enforcement was actually correct, since apparently alignment of > size_t.sizeof is enough. It is actually too weak, but enforcing 16-byte alignment is not the correct solution either, see new try at http://d.puremagic.com/issues/show_bug.cgi?id=6635