[cxx-abi-dev] Name mangling question

nasgaard at ca.ibm.com nasgaard at ca.ibm.com
Wed Nov 27 16:25:36 UTC 2002


Mark,  I don't see the difference between that and this example (except we
don't have a substitution).

struct locale {
   struct Bar
   {
   };
   struct _Impl
   {
      void foo(Bar&);
   };
};

int main() {
   locale::Bar b;
   locale::_Impl i;
   i.foo(b);
}

Here the mangled name is _ZN6locale5_Impl3fooERNS_3BarE.  Note the N...E.
Unless I have a gross misunderstanding (which is possible) we build up the
type by following productions through type and nested name.  Then, after
building a name we look for a substitution.  If we forget substitution for
a moment this name would be _ZN6locale5_Impl3fooERN6locale3BarE.  And my
other example would be _ZN6locale5_Impl3fooERN6locale5_ImplE which seems
right while the g++ one would be _ZN6locale5_Impl3fooER6locale5_Impl.

I just got a note fromMartin which may hold a key.  I'll respond to that
one.  Please wait for that before you respond to this.

Thanks for your patience.


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



                                                                                                                                                  
                      Mark Mitchell                                                                                                               
                      <mark at codesourcer        To:       Howard Nasgaard/Toronto/IBM at IBMCA                                                        
                      y.com>                   cc:       "cxx-abi-dev at codesourcery.com" <cxx-abi-dev at codesourcery.com>                            
                                               Subject:  Re: [cxx-abi-dev] Name mangling question                                                 
                      11/27/2002 10:55                                                                                                            
                      AM                                                                                                                          
                                                                                                                                                  
                                                                                                                                                  





--On Wednesday, November 27, 2002 10:55:45 AM -0500 "nasgaard at ca.ibm.com"
<nasgaard at ca.ibm.com> wrote:

> Mark,  What happened to the N...E around the nested name.  The type
should
> be N6locale5_ImplE should it not?  S0_ is not the substitute for that.
Is
> there a caveat here that drops them?

SO_ is the substitution for a type, not a name.  So, when you reach
::locale::_Impl in the function type, you replace it with SO_.

--
Mark Mitchell                mark at codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com






More information about the cxx-abi-dev mailing list