Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cxx-abi-dev] Name mangling question


  • To: loewis@xxxxxxxxxxxxxxxxxxxxxxx (Martin v. Löwis)
  • Subject: Re: [cxx-abi-dev] Name mangling question
  • From: nasgaard@xxxxxxxxxx
  • Date: Wed, 27 Nov 2002 08:34:33 -0500

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@xxxxxxxxxx
C2/KD2/8200/MKM
905-413-3683
Tie: 969-3683



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



nasgaard@xxxxxxxxxx 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