[cxx-abi-dev] mangling parenthesized vs. non-parenthesized calls

David Vandevoorde daveed at edg.com
Mon Apr 25 16:24:15 UTC 2011


On Apr 24, 2011, at 2:34 AM, John McCall wrote:

> Parentheses in C++ don't matter except when they do.  One case
> that our mangling doesn't seem to capture correctly is when a call
> operand is an unqualified id-expression, e.g.:
> 
>  template <class T> auto call(T t) -> decltype(foo(t)) {
>    return foo(t);
>  }
> 
> vs.
> 
>  template <class T> auto call(T t) -> decltype((foo)(t)) {
>    return foo(t);
>  }
> 
> In the second case, argument-dependent lookup is suppressed,
> but both will be mangled identically because parentheses are
> dropped and we only have one call mangling.


Nice catch!


> 
> We probably don't want to change the mangling for calls in
> general, so I would suggest
>  <expression> ::= cp <simple-id> <expression>* E
> which will *only* be used for calls where the function operand
> is parenthesized and where ADL would be triggered if it weren't.

Yes, that seems reasonable.

	Daveed




More information about the cxx-abi-dev mailing list