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

Jason Merrill jason at redhat.com
Thu Oct 30 20:04:58 UTC 2008


I'd like to get more opinions on this subject.  Again, the issue is how 
to deal with expressions with a dependent but still describable type in 
the context of decltype (and sizeof/alignof).

This is a category which doesn't appear in the standard, but seems 
pretty well defined: an expression has indescribable type if it is 
potentially a call to an overloaded function, including operators, other 
than conversion operators or constructors, or it is a reference to a 
member of an unknown specialization.

These are the only expressions for which the simplest way we can express 
their type involves decltype.  All other expressions have a type which 
can be expressed without decltype, even if it is something like typename 
A<T>::B, and so I would like to do that.

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.

Does this make sense to people?  The alternative is to limit this to 
certain forms.  We definitely need to do this for function parameters 
and template non-type parameters because there's no other way to 
represent them, the question then is whether this should be limited to 
them or used more generally to reduce the size of the mangled names.

Jason



More information about the cxx-abi-dev mailing list