https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95349
--- Comment #7 from Andrew Downing <andrew2085 at gmail dot com> --- (In reply to Jonathan Wakely from comment #6) > (In reply to Andrew Downing from comment #5) > > Also, I'm not sure if operations that implicitly create > > objects in storage are allowed to do so if an object has already explicitly > > created in that storage (from new). > > The lifetime of the object created with new ends as soon as the storage is > reused for another object. But I'm not sure if copying new bytes to it does > reuse the storage or not. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0593r6.html "We could specify that implicit object creation happens automatically at any program point that relies on an object existing." I don't believe operations that implicitly create objects are supposed to do so if an object has already implicitly or explicitly been created in that storage, unless that object is a char/unsigned char/std::byte array, since reading out those back out is always valid anyway.