Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: "Jason Merrill" <jason@xxxxxxxxxx>
  • Subject: Re: [cxx-abi-dev] Mangling late-specified return types/decltype
  • From: "Lawrence Crowl" <crowl@xxxxxxxxxx>
  • Date: Mon, 8 Sep 2008 14:20:00 -0700

On 9/5/08, Jason Merrill <jason@xxxxxxxxxx> 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