[Bug c++/28017] lack of guard variables for explicitly instantiated template static data

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Jun 21 05:05:00 GMT 2006



------- 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



More information about the Gcc-bugs mailing list