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

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Feb 22 06:47:37 2019
New Revision: 269095

URL: https://gcc.gnu.org/viewcvs?rev=269095&root=gcc&view=rev
Log:
        PR c++/87685 - generic lambda 'this' capture error.

The standard says that in a generic lambda we should speculatively capture
'this' if we see a call to an overload set that contains a non-static member
function, but it seems wrong to reject the program if we can't capture,
since it might not actually be needed.

        * lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
        (maybe_generic_this_capture): Pass -1.

Added:
    trunk/gcc/testsuite/g++.dg/cpp1y/lambda-generic-this3.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/lambda.c

Reply via email to