Updated mangling specs
Daveed Vandevoorde
daveed at edg.com
Fri Jan 28 19:06:23 UTC 2000
Martin von Loewis wrote:
>
> > It's definitely the latter interpretation. The intent was to express the
> > "inverted A" quantifier, though it probably would have been clearer to
> > say "for all" instead of "for any".
>
> I trust you that this was indeed the intent. However, it seems that
> the only reasonable implementation is to encode all expressions as
> they appear in the source. If that is done, what can be saved by not
> having to tell functionally-equivalent templates apart? Using an
> expression encoding, 'I+10' and 'I+1+2+3+4' would turn out to be
> different, so why explicitly mention that an implementation could
> consider them equivalent?
You can either mangle the sequence of tokens after normalizing the
parameter tokens (e.g., "J+10" and "L+10" are definitely equivalent
if L and J are both first template parameters of the nontype kind),
or you can construct a mangled representation of the tree structure
representing the expression. In the latter case, you might have
constant-folded nondependent subexpressions.
The EDG front end does the former, but HP aC++ does the latter.
// File 1:
template<int I> void f(double (&)[I+1+2]) {}
template void f<1>(double (&)[4]); // (1)
// File 2:
template<int I> void f(double (&)[I+3]) {}
template void f<1>(double (&)[4]); // Links up with (1) on aC++
// but not with EDG
Daveed
More information about the cxx-abi-dev
mailing list