[cxx-abi-dev] Name mangling question

nasgaard at ca.ibm.com nasgaard at ca.ibm.com
Wed Nov 27 13:34:33 UTC 2002


The mangled name you specified would be correct if there was a struct _Impl
at namespace scope.  For the function in question we need to mangle the
type of the parameter which, in my example, is locale::_Impl, a nested
class.

Howard W. Nasgaard
C++ Compiler Development
e-mail: nasgaard at ca.ibm.com
C2/KD2/8200/MKM
905-413-3683
Tie: 969-3683



                                                                                                                                                    
                      loewis at informatik.h                                                                                                           
                      u-berlin.de (Martin        To:       Howard Nasgaard/Toronto/IBM at IBMCA                                                        
                      v. Löwis)                  cc:       cxx-abi-dev at codesourcery.com                                                             
                                                 Subject:  Re: [cxx-abi-dev] Name mangling question                                                 
                      11/27/2002 07:53 AM                                                                                                           
                                                                                                                                                    
                                                                                                                                                    



nasgaard at ca.ibm.com writes:

> struct locale {
>    struct _Impl
>    {
>       void foo(_Impl&);
>    };
> };
> It would seem that 6locale would have S_ as a substitution, and
> 6locale5_Impl would have S0_.  Given that the parameter is a nested name
> and so should be within N/E delimiters,  I don't see how g++ arives at
that
> mangling.

The parameter is not a nested name, the signature of foo really is

void ::locale::_Impl::foo(::locale::_Impl&);

That you can denote the parameter type as _Impl in C++ is irrelevant
for the mangling, since the mangling uses always the fully-qualified
names. The symbol

_ZN6locale5_Impl3fooER5_Impl

would denote the function

::locale::_Impl::foo(::_Impl&)

HTH,
Martin






More information about the cxx-abi-dev mailing list