Really obscure C++ mangling error with -fnew-abi

Alex Samuel samuel@codesourcery.com
Mon Jul 10 18:12:00 GMT 2000


Martin v. Loewis writes:

  Mark> I fixed this bug with the following patch.  After the patch,
  Mark> this:
  Mark> 
  Mark> 00000000 W _ZSt26__uninitialized_fill_n_auxIPSsjSsET_S1_T0_RKT1_5_BoolILb0EE
  Mark> 
  Mark> is the only output from `nm' containing uninitialized_fill_n_aux,
  Mark> which is a good sign.  This demangles to:
  Mark> 
  Mark> std::string* std::__uninitialized_fill_n_aux<std::string*,
  Mark> unsigned, std::string> (std::string*, unsigned, const
  Mark> std::string&, _Bool<false>)

  Martin> I'm having problems with the numbering of things (the S1_
  Martin> part in particular); I'd appreciate if anybody could correct
  Martin> me. 

In this mangling, std::__uninitialized_fill_n_aux is a substitution
candidate because it is a template name.  The name of a function
without its signature (whether it is a template-id or not templated)
is not a substitution candidate, but the name of an uninstantiated
template (whether it is a class or function template) is.

So, the first few substitution candidates are

    S_   = std::__uninitialized_fill_n_aux
    S0_  = std::string* (as appears in template args)
    S1_  = T_ = std::string*

Note that there is no special provision in the mangling rules for
omitting substitution candidates that are not (or cannot be) later
used.  

Regards
Alex


More information about the Gcc-bugs mailing list