This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60755] lambda capturing `this` doesn't honor const qualifier of the enclosing member function
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 09 May 2014 20:08:16 +0000
- Subject: [Bug c++/60755] lambda capturing `this` doesn't honor const qualifier of the enclosing member function
- Auto-submitted: auto-generated
- References: <bug-60755-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60755
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri May 9 20:07:45 2014
New Revision: 210292
URL: http://gcc.gnu.org/viewcvs?rev=210292&root=gcc&view=rev
Log:
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.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const-this.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/lambda.c
trunk/gcc/cp/semantics.c