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

--- Comment #23 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Bernd Edlinger from comment #22)
> (In reply to Jakub Jelinek from comment #20)
> > which fails also on x86_64-linux at -O2.  And that testcase regressed with
> > r223126.  Now whether this is valid C++, no idea, placement new is messy.
> 
> This test case can't be valid, suppose the A has a copy constructor
> that that is also not called when B is moved around.

The canonical fix is to put the type you placement new into the union storage
into the union as regular member rather than having a char[] member in the
union.

Reply via email to