[cxx-abi-dev] Mangling braced-init-list

Jason Merrill jason at redhat.com
Tue Jan 3 19:31:33 UTC 2012


On 01/03/2012 02:24 PM, Jason Merrill wrote:
> This doesn't seem to have been discussed yet, and GCC to date has just
> rejected any testcase that required such mangling. It seems
> straightforward to just represent it as a list of expressions:
>
> <expression> ::= il <expression>* E
> <expression> ::= tl <type> <expression>* E

So,

template <class T> T g(T t1, T t2);

// _Z2f1IiEDTcl1gfp_ilEEET_
template <class T> auto f1 (T t) -> decltype(g(t,{}));
// _Z2f2IiEDTcl1gfp_tlT_EEES0_
template <class T> auto f2 (T t) -> decltype(g(t,T{}));

int main() { f1(0); f2(0); }

Jason



More information about the cxx-abi-dev mailing list