[Bug c++/67703] assert after placement new

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Sep 24 05:23:00 GMT 2015


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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>  A* b = new(&a) B;


I think that is wrong.  it should have been "new(a) B;"  Otherwise you are
allocating the new object with the space for the variable a instead of what a
points to.



More information about the Gcc-bugs mailing list