[Bug c++/55893] C++11: runtime segfault with static const object with virtual destructor
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55893 --- Comment #1 from Frank Heckenbach f.heckenb...@fh-soft.de 2013-01-07 07:21:01 UTC --- Submitted to early. Here's the description: The attached test case segfault at runtime: % g++-4.7 -std=c++11 bug.cpp ./a.out Segmentation fault As far as I can see, that's because tmp is allocated in read-only storage, but the destructor tries to write to it to update the vtable pointer. It only happens in C++11 mode.
[Bug c++/55893] C++11: runtime segfault with static const object with virtual destructor
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55893 Andrew Pinski pinskia at gcc dot gnu.org changed: What|Removed |Added Keywords||wrong-code Status|UNCONFIRMED |NEW Last reconfirmed||2013-01-07 Ever Confirmed|0 |1 --- Comment #2 from Andrew Pinski pinskia at gcc dot gnu.org 2013-01-07 07:40:21 UTC --- Confirmed, also fails on the trunk. .section.rodata .align 8 .type_ZZ4mainE3tmp, @object .size_ZZ4mainE3tmp, 8 _ZZ4mainE3tmp: .quad_ZTV3foo+16 .weak_ZTI3foo