OSDN Git Service

Fix lookup of initialized captures in unevaluated context.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Oct 2009 22:14:01 +0000 (22:14 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Oct 2009 22:14:01 +0000 (22:14 +0000)
commit7da3c25a95641edd488f078f418e1aa664432f87
tree91a2cc25814e680725f6c140def08bac99194893
parent80c8ed0239da3e68de63741501fa15f0419c4cd4
Fix lookup of initialized captures in unevaluated context.
* cp-tree.h (DECL_NORMAL_CAPTURE_P): New.
* name-lookup.c (qualify_lookup): Check it.
* parser.c (cp_parser_lambda_introducer): Pass explicit_init_p
to add_capture.
* semantics.c (add_capture): Set DECL_NORMAL_CAPTURE_P
on captures without explicit init.
(add_default_capture): Pass explicit_init_p.

Fix capture by copy of types with explicit copy constructor.
* cp-tree.h (TARGET_EXPR_DIRECT_INIT_P): New.
(DIRECT_INIT_EXPR_P): New.
* typeck.c (convert_for_initialization): Just return if
DIRECT_INIT_EXPR_P.
* parser.c (cp_parser_lambda_introducer): Use
TARGET_EXPR_DIRECT_INIT_P for normal captures.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152500 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/name-lookup.c
gcc/cp/parser.c
gcc/cp/semantics.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-direct-init.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-init.C [new file with mode: 0644]