https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99965
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Juan Lucas Rey from comment #7) > the thing is removing the vector m_vPointers makes it work. Just by accident. > also this code works fine on clang.. why would it be misaligned? Because pBuf only needs to be aligned to 1 so in this case it is aligned to 8, and adding size_0 (10*2=20=4*5) makes it aigned to only 4. If you want aligned storage, use std::aligned_storage instead.