re PR c++/43912 ([C++0x] lambda debug info does not describe captured variables)
authorJason Merrill <jason@redhat.com>
Fri, 17 Jun 2011 20:08:01 +0000 (16:08 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 17 Jun 2011 20:08:01 +0000 (16:08 -0400)
commit61ca4737a85b646c6f4f28e5a49e4f89fa44106b
tree1cc558a7e679f551ed8af13589db5f793e8cd923
parent7e7666aed8caa20d3351147e6875292ca27cf1d9
re PR c++/43912 ([C++0x] lambda debug info does not describe captured variables)

PR c++/43912
Generate proxy VAR_DECLs for better lambda debug info.
* cp-tree.h (FUNCTION_NEEDS_BODY_BLOCK): Add lambda operator().
(LAMBDA_EXPR_PENDING_PROXIES): New.
(struct tree_lambda_expr): Add pending_proxies.
* name-lookup.c (pushdecl_maybe_friend_1): Handle capture shadowing.
(qualify_lookup): Use is_lambda_ignored_entity.
* parser.c (cp_parser_lambda_expression): Don't adjust field names.
Call insert_pending_capture_proxies.
(cp_parser_lambda_introducer): Use this_identifier.
(cp_parser_lambda_declarator_opt): Call the object parameter
of the op() "__closure" instead of "this".
(cp_parser_lambda_body): Call build_capture_proxy.
* semantics.c (build_capture_proxy, is_lambda_ignored_entity): New.
(insert_pending_capture_proxies, insert_capture_proxy): New.
(is_normal_capture_proxy, is_capture_proxy): New.
(add_capture): Add __ to field names here, return capture proxy.
(add_default_capture): Use this_identifier, adjust to expect
add_capture to return a capture proxy.
(outer_lambda_capture_p, thisify_lambda_field): Remove.
(finish_id_expression, lambda_expr_this_capture): Adjust.
(build_lambda_expr): Initialize LAMBDA_EXPR_PENDING_PROXIES.
* pt.c (tsubst_copy_and_build): Check that LAMBDA_EXPR_PENDING_PROXIES
is null.

From-SVN: r175158
gcc/cp/ChangeLog
gcc/cp/cp-tree.def
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/name-lookup.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/debug/dwarf2/lambda1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wshadow-6.C