Mangling: Special names

Martin von Loewis loewis at informatik.hu-berlin.de
Mon Mar 27 14:05:50 UTC 2000


> Good question.  I interpreted C1/C2/C3/C4 as being the default
> constructors, with the following derivation for Foo::Foo(), which is
> the constructor for type Foo:
> 
>     <encoding>	-> _Z <name> <type>
> 		-> _Z <special-name> <class-enum-type>
> 		-> _Z C1 <source-name>
> 		-> _Z C1 3Foo
> 
> Your example, no longer the default constructor, becomes:
> 
> 	_ZN3Foo3FooEi

No, that won't work. Is this the in-charge, or not-in-charge
constructor? Is it allocating or not?

Reconsidering this, I think it is right to have the special names as
unqualified names in a nested name. Just as you'd have

_ZN3FoongE

to denote Foo::operator!(); you also have C1,... as *names* of the
constructors. Since we need more than one name per constructor, we
need to make them special

> > Likewise, _ZN3Foo3BarTVE would be the Foo::Bar virtual table.
> 
> No, it goes:
> 
>     <encoding>	-> _Z <name>	     <type>
> 		-> _Z <special-name> <class-enum-type>
> 		-> _Z TV	     <nested-name>
> 		-> _Z TV	     N 3Foo 3Bar E

In my view, the Foo::Bar virtual table is a static member of Foo::Bar,
which would be written down as 'Foo::Bar::__vtable'. Just as this
specific member would be encoded as

  _ZN3Foo3Bar8__vtableE

I would assume that the vtable is encoded with TV as the name of the
static member. Your approach would also work, but I feel this is more
consistent that way.

[Th and Tv discussion deleted]
> Any other interpretations out there?

Thanks, it seems clear now.

Martin




More information about the cxx-abi-dev mailing list