Re: [PR c++/86610] lambda captures in templates

2019-01-22 Thread H.J. Lu
On Wed, Jan 16, 2019 at 2:32 PM Jason Merrill wrote: > > On 1/16/19 4:48 PM, Nathan Sidwell wrote: > > This PR reports a bug where we select a non-const operator function and > > then apply it to a const object. That's happening because the > > expression 'c[0]' is not dependent, so we figure

Re: [PR c++/86610] lambda captures in templates

2019-01-16 Thread Jason Merrill
On 1/16/19 4:48 PM, Nathan Sidwell wrote: This PR reports a bug where we select a non-const operator function and then apply it to a const object.  That's happening because the expression 'c[0]' is not dependent, so we figure end up resolving it. But the lambda capture logic doesn't capture

[PR c++/86610] lambda captures in templates

2019-01-16 Thread Nathan Sidwell
This PR reports a bug where we select a non-const operator function and then apply it to a const object. That's happening because the expression 'c[0]' is not dependent, so we figure end up resolving it. But the lambda capture logic doesn't capture 'c' at that point and we have a non-const