]> gcc.gnu.org Git - gcc.git/commit
Fix lookup of initialized captures in unevaluated context.
authorJason Merrill <jason@redhat.com>
Tue, 6 Oct 2009 22:14:01 +0000 (18:14 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 6 Oct 2009 22:14:01 +0000 (18:14 -0400)
commit37a7519a24389c6e724566944b654e0ad3654a79
tree91a2cc25814e680725f6c140def08bac99194893
parentebde32fd2478df9909e07843451956ce89a02b46
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.

From-SVN: r152500
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]
This page took 0.197026 seconds and 5 git commands to generate.