This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Really obscure C++ mangling error with -fnew-abi
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Really obscure C++ mangling error with -fnew-abi
- From: Chip Salzenberg <chip at valinux dot com>
- Date: Fri, 30 Jun 2000 17:29:27 -0700
C++ folks: This is going to be hard to slog through -- or at least
hard to read -- but please bear with me. I think it's a real bug.
It might even be two bugs.
-----------------------------------------------------------------------
The attached source file, when compiled with -fnew-abi and
-fimplicit-templates, defines a constructor named:
_ZSt26__uninitialized_fill_n_auxIPSbIcSt11char_traitsIcESaIcEEjS3_ET_S5_T0_RKT1_5_BoolILb0EE
which, when translated, means:
std::basic_string<char, std::char_traits<char>, std::allocator<char> >*
std::__uninitialized_fill_n_aux<std::basic_string<char,
std::char_traits<char>,
std::allocator<char> >*,
unsigned,
std::allocator>
(std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
unsigned, const std::allocator&, _Bool<false>)
Note that the third template parameter is std::allocator<char>.
However, this is wrong in at least one way, and maybe two.
(1) The function in question is _referenced_ -- by code compiled with the
same compiler! -- under a _different_ name:
_ZSt26__uninitialized_fill_n_auxIPSbIcSt11char_traitsIcESaIcEEjSsET_S5_T0_RKT1_5_BoolILb0EE
which, when translated, means:
std::basic_string<char, std::char_traits<char>, std::allocator<char> >*
std::__uninitialized_fill_n_aux<std::basic_string<char,
std::char_traits<char>,
std::allocator<char> >*,
unsigned,
std::string>
(std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
unsigned, const std::string&, _Bool<false>)
This reference name is likely to be more correct than the definition
name, since the third template parameter of __uninitialized_fill_n_aux
is supposed to be a value type, not an allocator type.
(2) Why is std::string showing up as std::string in some places and as
"basic_string<char, std::char_traits<char>, std::allocator<char> >" in
other places??
--
Chip Salzenberg - a.k.a. - <chip@valinux.com>
"I wanted to play hopscotch with the impenetrable mystery of existence,
but he stepped in a wormhole and had to go in early." // MST3K
misc-inst.i.gz