This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28017] lack of guard variables for explicitly instantiated template static data
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jun 2006 04:50:48 -0000
- Subject: [Bug c++/28017] lack of guard variables for explicitly instantiated template static data
- References: <bug-28017-11686@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from pinskia at gcc dot gnu dot org 2006-06-21 04:50 -------
Actually I take that back, it is also a problem with targets that don't have
weak symbols too.
On x86_64-linux-gnu with the additional flag of -fno-weak:
pc64:~> g++ test.cc test1.cc -fno-weak
pc64:~> ./a.out
new: mString has value 0x502010
new: mString has value 0x502030
delete: mString has value 0x502030
delete: mString has value 0x502030
*** glibc detected *** double free or corruption (fasttop): 0x0000000000502030
***
Abort
So the new part of the test should be just shrunk back to testing
DECL_EXPLICIT_INSTANTIATION instead of the other parts too.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
GCC target triplet|*-darwin |non weak
Target Milestone|--- |4.0.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28017