[cxx-abi-dev] Mangling late-specified return types/decltype

Mark Mitchell mark at codesourcery.com
Thu Oct 30 20:40:09 UTC 2008


Jason Merrill wrote:

> If we are mangling decltype(expr with describable type), we just replace
> that with the type.  Otherwise, within decltype/sizeof/alignof, if a
> subexpression has describable type we replace it in the mangling with a
> type stub: sT <type> if decltype((subexpression)) is a reference type,
> or sR <type> if it is not.

Is the type of the expression sufficiently canonical?  For example, I
worry that one compiler will decide the expression has type "typename
A<T>::B" while another decides that the type is "int" because it
resolves a dependent type, or "typename A<T>::C" (because there's a
typedef equating "B" and "C"), or some such.  Or even things like
determining that the type is "void ()(T[3])" vs. "void ()(T*)".

In other words, the advantage to a syntactic mangling based on the form
of the decltype expression is that it's more obvious what the right
answer is, whereas the a semantic mangling based on your definition of
describable type might not be as well-defined.

I've not been keeping up sufficiently with the latest C++ standards
development to know how fair such a worry might be, so I apologize in
advance if this is obviously moot.

-- 
Mark Mitchell
CodeSourcery
mark at codesourcery.com
(650) 331-3385 x713



More information about the cxx-abi-dev mailing list