https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65209
--- Comment #2 from Sandro Mani <manisandro at gmail dot com> --- Created attachment 34874 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34874&action=edit Slightly reduced test case ==30483== Invalid free() / delete / delete[] / realloc() ==30483== at 0x4C2D143: operator delete(void*) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==30483== by 0x400983: Foo::~Foo() (foo.cpp:4) ==30483== by 0x40099F: (anonymous namespace)::Q_QGS_s_self::innerFunction()::Holder::~Holder() (foo.cpp:21) ==30483== by 0x570F627: __run_exit_handlers (in /usr/lib64/libc-2.21.90.so) ==30483== by 0x570F674: exit (in /usr/lib64/libc-2.21.90.so) ==30483== by 0x56F5846: (below main) (in /usr/lib64/libc-2.21.90.so) ==30483== Address 0x1 is not stack'd, malloc'd or (recently) free'd