On 02.09.2013 19:34, Jason Merrill wrote:
On 09/02/2013 02:30 PM, Adam Butcher wrote:
On 01.09.2013 21:22, Jason Merrill wrote:
I bet we want convert_from_reference in the non-generic lambda
case, too.
I think I had made that change originally to keep the two impls the
same
and I hit issues with non-generic lambdas. But I can't remember the
details. I'll try again.
Okay, finally got around to trying this again. With
convert_from_reference in the non-generic case, the code compiles okay
but SEGVs on the attempt to branch to '_FUN'.
│105 auto lf0 = [] (float& a, int const& b) { return a += b; };
│106
│107 INVOKEi (lf, float, 7, 0);
>│108 AS_FUNi (lf, float, 7, 0);
│109 AS_PTRi (lf, float, int, 7, 0);
│0x404500 <main()+14687> mov %eax,-0x4bc(%rbp)
│0x404506 <main()+14693> mov 0x36f0(%rip),%eax # 0x407bfc
│0x40450c <main()+14699> mov %eax,-0x4c0(%rbp)
│0x404512 <main()+14705> movl $0x7,-0x2a4(%rbp)
│0x40451c <main()+14715> lea -0x2a4(%rbp),%rdx
│0x404523 <main()+14722> lea -0x4bc(%rbp),%rax
│0x40452a <main()+14729> mov %rdx,%rsi
│0x40452d <main()+14732> mov %rax,%rdi
>│0x404530 <main()+14735> callq 0x400934 <<lambda(float&, int
const&)>::_FUN(float &, const int &)>
If it works with convert_from_reference in
both cases should I push or should I sort out the parameter pack
conversion op issue and roll that up into this?
I think roll them together, since that patch rewrites parts of this
one.
Will assume, for now, that the convert_from_reference call is not
wanted in the non-generic case (maybe something to do with using
'build_call_a' instead of 'build_nt_call_vec' or the
convert_from_reference on the call itself?) and will focus on the
parameter pack stuff (when I get a chance).
Cheers,
Adam