This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/53324] Crash when mixing _GLIBCXX_DEBUG and non-_GLIBCXX_DEBUG std::deque
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 11 May 2012 17:20:13 +0000
- Subject: [Bug libstdc++/53324] Crash when mixing _GLIBCXX_DEBUG and non-_GLIBCXX_DEBUG std::deque
- Auto-submitted: auto-generated
- References: <bug-53324-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53324
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-11 17:20:13 UTC ---
N.B. this is basically the same scenario as if you compiled x.C, then changed
XX::getme to return a std::list instead of std::deque, then compiled y.C -- it
would link, but crash at runtime. This is a general "feature" of C++
name-mangling and separrate compilation, not specific to our debug mode.
If you create a file called "deque" in the same directory containing:
#include <list>
#define deque list
then change the makefile to build y.o with this rule, not using debug mode:
y.o: y.C
g++ -c -I. y.C
then it will link (even though you can't assign std::list to std::deque, i.e.
your suggestion won't help) but it will segfault when run.