This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
bug with -fleading-underscore doubling underscore in some cases on templates
- From: Stephane Hockenhull <shockenhull at niceberg dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 20 Nov 2007 13:59:23 -0500
- Subject: bug with -fleading-underscore doubling underscore in some cases on templates
hi,
we have found a case where g++ will generate template instantiations with two
underscore prefixes (std::string, "__ZNSs7reserveEm" instead of just
"_ZNSs7reserveEm") while other .cpp files will compile just fine.
the template stabs sections are correctly setup as "_ZNSs7reserveEm" but the
assembly code that calls the functions have two underscores instead so the
linker cannot find the template and complain of undefined reference to
__XXXXX
I tried moving things around in that particular cpp file to make the bug go
away (and isolate the case) to no avail.
and std::string is the only template that seem to cause the behaviour
i386-unknown-elf-g++ (GCC) 4.1.1
--
Stephane Hockenhull
SSC-Studios.com