[cxx-abi-dev] Name mangling question

Martin v. Löwis loewis at informatik.hu-berlin.de
Wed Nov 27 16:55:52 UTC 2002


nasgaard at ca.ibm.com writes:

> Martin,  Your observation may be the key here.  we are mangling ::locale::
> _Impl.  Is the following sequence of productions correct?

It is a valid production sequence, but it is irrelevant for the case
under question, and it is incomplete:

1. You have to start with <type>, not with <nested-name>.
2. You have to take compression into account *before* applying
   any production rules.
3. _Impl is not an unqualified name. In C++, in this context,
   _Impl is the same as locale::_Impl.

> <nested-name> ::= N [<CV-qualifiers>] <prefix> <unqualified-name> E    <<
> there is no substitution here.  _Impl is the unqualified name

No, it is not. The parameter type is locale::_Impl, not _Impl. There is
no unqualified type _Impl in your example, as you noted yourself.

You need to understand that the names of the non-terminals are irrelevant,
it appears that you have been mislead to interpret things into the names
of production rules that they are not intended to mean:
1. <nested-name> and <unqualified-name> does *not* refer to the way
   that the names happen to appear in source code.
2. It also does *not* necessarily refer to the question whether the
   fully-qualified names are in the global namespace or not.
Instead, this is a syntactical property of the mangled name: Does
the mangled name contain qualifiers or not.

Regards,
Martin



More information about the cxx-abi-dev mailing list