On Thu, 4 Jun 2020 at 11:00, Marc Glisse <[email protected]> wrote: > Maybe create a buffer, fill it with some non-zero values (-1?), then call > placement new, and read some value in the middle of the buffer, possibly > with some protection against optimizations? Ah, no, actual constructors > are fine, it is only the inlined initialization that happens with the > defaulted constructor that zeroes things.
The zero-init is part of value-initialization of a class type with a defaulted default constructor, so value-initialization with placement new should indeed show us whether the target buffer is zeroed.
