Updated mangling specs

mendell at ca.ibm.com mendell at ca.ibm.com
Thu Jan 27 14:23:19 UTC 2000



Our template/standard guy thinks that this is not essential.  His words:



   My understanding of 14.5.5.1 is that it says that this mangling is not
   required.  Paragraphs 6 to 8 define equivalent and functionally
   equivalent expressions and function templates.

   'I + 10' and 'I + 1 + 2 + 3 + 4' are not equivalent but they are
   functionally equivalent.

   I think the mangling described below could be used to make all
   nonequivalent functions disctinct, but these paragraphs state that only
   functionally equivalent function template are distinct.

   Quotes from paragraph 8 of 14.5.5.1.

   'This rule quarantees that equivalent declarations will be linked with
   one another, while not requiring implementations to use heroic efforts
   to guarantee that functionally equivalent declarations will be treated
   as distinct'.  I believe the mangling described below is the heroic
   effort mentioned here.

   '// Ill-formed, no diagnostic required
    template <int I> void f(A<I>, A<I+10>);
    template <int I> void f(A<I>, A<I+1+2+3+4>);'

   I'm guessing that the mangling below would be used to make this well
   formed by making these two functions distinct.

   Having said all this, I'm not 100% sure that I'm right.






mendell at ca.ibm.com wrote:
>
> Does anyone implement this for templates?
>
>    c) an expression, e.g., "B<(J+1)/2>" is encoded with a prefix
traversal
>       of the operators involved, delimited by "X...E".  The operators are
>       encoded using their two letter mangled names.  For example,
> "B<(J+1)/2>"
>       becomes "1BI Xdv pl T1_ Li1E Li2E E E" (the blanks were inserted to
>       visualize the decomposition).
>
> We certainly don't.  The expression gets converted to an integer value in
> our compiler, and the integer is what is encoded.
>
> Can you tell me what part of the standard applies here?

Sure: it's 14.5.5.1 (most paragraphs).

     Daveed






More information about the cxx-abi-dev mailing list