re PR c++/60463 (Lambda function can call a non-const member function with const...
authorMomchil Velikov <momchil.velikov@gmail.com>
Fri, 9 May 2014 20:07:45 +0000 (20:07 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 9 May 2014 20:07:45 +0000 (16:07 -0400)
commit0b360a07d3a45a1217ba68345601efcb6c118089
tree41b9d15713d8f0e4386d503ec289e72ab4ec967b
parent91b67b5022b44a7eec12364a9e8d26507a6a87d6
re PR c++/60463 (Lambda function can call a non-const member function with const this)

PR c++/60463
PR c++/60755
* lambda.c (lambda_expr_this_capture): Add new parameter
add_capture_p controlling whether the functions will try to
capture 'this' via the default capture.
(maybe_resolve_dummy): Likewise.
* cp-tree.h: Adjust prototypes.
* call.c, semantics.c: Change callers of these functions.
* call.c (build_new_method_call_1): Use the actual 'this' that
would be potentially captured for the overload resolution, instead
of the dummy object.

From-SVN: r210292
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/lambda.c
gcc/cp/semantics.c
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const-this.C [new file with mode: 0644]