On 2015-04-17 20:58, Jason Merrill wrote:
On 04/09/2015 11:31 PM, Adam Butcher wrote:
+ /* For generic lambdas, resolve default captured 'this' now. */
This isn't quite right. We don't want to capture 'this' any time we
see a member function call, as overload resolution might choose a
static member function that doesn't need 'this'. The special
handling
we want is for the case where the call depends on a generic lambda
parameter, in which case we capture 'this' because the call "names
[this] in a potentially-evaluated expression (3.2) where the
enclosing
full-expression depends on a generic lambda parameter declared within
the reaching scope of the lambda-expression."
Good point. I'll look into it. So for a nullary member call we will
always capture 'this', but for N-ary, we only capture if we find one of
the lambda's parameters (or a parameter from an enclosing generic
lambda?) in the call's arguments right?
Cheers,
Adam