[cxx-abi-dev] Mangling late-specified return types/decltype
Lawrence Crowl
crowl at google.com
Mon Sep 8 21:20:00 UTC 2008
On 9/5/08, Jason Merrill <jason at redhat.com> wrote:
> Consider
>
> template<class T, class U>
> auto add(T t, U u) -> decltype (t+u);
>
> There is currently no way to mangle "t" in the ABI. Currently I'm dealing
> this by replacing "t" in the return type with *(T*)0, but that seems
> inelegant (and unnecessarily long).
Are you suggesting the mangling of the template itself or of its instances?
For the latter, shouldn't we be using the regular mangling?
>
> I think we don't want to mangle it as a reference to a function parameter,
> but rather as a placeholder expression with the type of the parameter.
> Perhaps sT <type>?
>
> Incidentally, the ABI still lacks any way to mangle T() or myfn(args).
>
> We could mangle T() using 'v' for the operand.
>
> We could mangle myfn(args) as a binary expression using the encoding for
> operator() where the first operand is the name of the function and the
> second operand is the list of args wrapped in some delimiters.
>
> Do these seem reasonable to other people?
>
>
--
Lawrence Crowl
More information about the cxx-abi-dev
mailing list