[Bug c++/43912] [C++0x] lambda debug info does not describe captured variables

2011-06-17 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43912

--- Comment #3 from Jason Merrill jason at gcc dot gnu.org 2011-06-17 
20:08:06 UTC ---
Author: jason
Date: Fri Jun 17 20:08:01 2011
New Revision: 175158

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=175158
Log:
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.

Added:
trunk/gcc/testsuite/g++.dg/debug/dwarf2/lambda1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.def
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/name-lookup.c
trunk/gcc/cp/parser.c
trunk/gcc/cp/pt.c
trunk/gcc/cp/semantics.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/warn/Wshadow-6.C


[Bug c++/43912] [C++0x] lambda debug info does not describe captured variables

2011-06-17 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43912

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.7.0

--- Comment #4 from Jason Merrill jason at gcc dot gnu.org 2011-06-17 
20:13:24 UTC ---
Fixed for 4.7.0.


[Bug c++/43912] [C++0x] lambda debug info does not describe captured variables

2011-06-15 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43912

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 AssignedTo|unassigned at gcc dot   |jason at gcc dot gnu.org
   |gnu.org |