https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97214

--- Comment #1 from Steven Franzen <sfranzen85 at hotmail dot com> ---
Bug 97219 looks similar. Unqualified name lookup should consider the scope
containing the lambda, which here is a member function and also includes the
full scope of its class. Similar example at
http://en.cppreference.com/w/cpp/language/lambda:

For the purpose of name lookup, determining the type and value of the this
pointer and for accessing non-static class members, the body of the closure
type's function call operator is considered in the context of the
lambda-expression.

struct X {
    int x, y;
    int operator()(int);
    void f()
    {
        // the context of the following lambda is the member function X::f
        [=]()->int
        {
            return operator()(this->x + y); // X::operator()(this->x +
(*this).y)
                                            // this has type X*
        };
    }
};

Reply via email to