https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81524
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- If you want to reliably detect this, just use -fsanitize=address, starting with GCC 7.x there is use after scope sanitization that should report this.