https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86908

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
No, your program has undefined behaviour. To make it valid you either need to
use std::launder, or use the pointer that is returned by the placement new.

The compiler is allowed to assume that the dynamic type of &strategy does not
change (that's why you need to use std::launder).

Reply via email to