mangling example

Alain Miniussi alainm at cup.hp.com
Thu Apr 13 22:02:19 UTC 2000


Martin von Loewis wrote:
> 
> > You raise another issue.  I believe that our intent was that
> > the candidates at this point include:
> >
> >   S_  void
> >   S0_ first<Duo>
> >   S1_ Duo
> >   S2_ first
> >
> > But I don't see the substitution of first in the grammar.
> > Is this what the others had in mind, too?

The following example seems to indicate that the intent was to allow
the substitution for "first" too (from "compression"):

   "S_" == N::T<int, int>::mf
   "S0_" == N::T<int, int>
   "S1_" == int
   "S2_" == N::T (template is less recent than template-id)
   "S3_" == N (qualifier is less recent than qualified entity)
 
> It would be certainly desirably to have first as a candidate as well.

Yes, basicaly, if we have an instantiated name, it would be desirable
to have the name, then the name+<template args> as candidates.
But the surrent grammar factorise <template-args> on unqualified name 
and class name (in order to have a more compact representation ?), 
which prohibit these substitution, if we have the name:

N1<T1>::N2<T2>

we have the candidates:

N1<T1>
N1<T1>::N2<T2>

instead of 

N1
N1<T1>
N1<T1>::N2
N1<T1>::N2<T2>

I think the following modification fix the problem (the grammar is a 
little bit permissive, but this is probably not an issue):
  
    <name> ::= <nested-name>
           ::= <unqualified-name>
           ::= <unqualified-name><template-args>
           ::= <local-name>     # See Scope Encoding below
           ::= <substitution> # See Compression below

    <nested-name> ::= N <qualified-name> E
    <qualified-name> ::= <method-name>
                     ::= <compound-name>
                     ::= <substitution>

// unrelated issue, but since CV only apply to method...:
    <method-name>    ::= <CV-qualifier>+<compound-name>

    <compound-name> ::= <compound-base-name><template-args>
                    ::= <compound-base-name>
                    ::= <substitution>

    <compound-base-name> ::= <nesting-preffix><unqualified-name>
                         ::= <substitution>

    <nesting-prefix> ::= <nesting-prefix><component>
                     ::= <component>
                     ::= <substitution>

    <component> ::= <source-name>
                ::= <template-args>

    <unqualified-name>::=<source-name>
                      ::=<operator-name>
                      ::=<special-name>

Any comment ?

Alain




More information about the cxx-abi-dev mailing list