[ Date Prev][ Date Next][ Thread Prev][ Thread Next][ Date Index][ Thread Index]
more mangling substitution woes
- To: cxx-abi@xxxxxxxxxxxxxxxxxxxx
- Subject: more mangling substitution woes
- From: Alex Samuel <samuel@xxxxxxxxxxxxxxxx>
- Date: Tue, 9 May 2000 23:04:20 -0700 (PDT)
I think the new name grammar still doesn't do what we want. Consider
for instance the example mangling of
void first<Duo>(/*nondependent*/Duo);
The example notes
(Note: first is S_, Duo is S1_, first is S2_)
and gives as the mangling
_Z5firstI3DuoEvS0_
I think the current grammar doesn't obtain all the substitutions we
want. Here's the tree:
<mangled-name> : void first<Duo> (Duo)
<encoding> : first<Duo>
* <name> : first<Duo>
<unqualified-name> : first<Duo>
<template-name> : first
<source-name> : first
<identifier> : first
<template-args> : <Duo>
* <type> : Duo
<class-enum-type> : Duo
<unqualified-name> : Duo
<source-name> : Duo
<identifier> : Duo
[done with <type>; S_ := Duo]
[done with <name>; S0_ := first<Duo>]
<bare-function-type> : void () (Duo)
<type> : void
<type> : Duo == S_
Productions that are substitution candidates are marked with a `*'.
The template name `first' is never made a substitution candidate (if
it were not in the global namespace, it would have hit
<template-prefix>, which would have created the candidate).
So what I think we need is something along these lines:
- Eliminate
<unqualified-name> ::= <template-name> <template-args>
- Add
<name> ::= <unqualified-template-name> <template-args>
<unqualifed-template-name> ::= <template-name>
::= <substitution>
That way top-level template names get substituted.
|