Re: [PR c++/83160] local ref to capture

2018-01-18 Thread Nathan Sidwell
On 01/17/2018 01:44 PM, Jason Merrill wrote: This makes sense to me. But I think we'd want also that flag set on the ck_identity inside the ck_base that direct_reference_binding creates, so setting it first rather than in an else. Ah yes, you spotted the bit I failed to mention. (I think we

Re: [PR c++/83160] local ref to capture

2018-01-17 Thread Jason Merrill
On Fri, Jan 12, 2018 at 2:11 PM, Nathan Sidwell wrote: > Jason, > this fixes 83160, where we complain about not having an lvalue in things > like: > > void foo () { > const int a = 0; > [&a] () { > const int &b = a; // here > }; > } > > The problem is that we in convert_like_real we hav

[PR c++/83160] local ref to capture

2018-01-12 Thread Nathan Sidwell
Jason, this fixes 83160, where we complain about not having an lvalue in things like: void foo () { const int a = 0; [&a] () { const int &b = a; // here }; } The problem is that we in convert_like_real we have ref_bind->identity conversions, and the identity conversion calls 'mark_