aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lambda.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-03-21 23:01:02 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-03-21 23:01:02 +0100
commit152d47df7f625885ae972386c759330cea6b169e (patch)
treedf1fa2daab768303053a87f6d65572c918d887e9 /gcc/cp/lambda.c
parent36a3a7a3726c8b65eeceb6eb4a8946e0cd5650a9 (diff)
downloadgcc-152d47df7f625885ae972386c759330cea6b169e.zip
gcc-152d47df7f625885ae972386c759330cea6b169e.tar.gz
gcc-152d47df7f625885ae972386c759330cea6b169e.tar.bz2
re PR c++/89767 (ICE with tuple and optimization)
PR c++/89767 * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id variables, check for duplicates in this function. * lambda.c (add_capture): Don't check for duplicates nor use IDENTIFIER_MARKED. (register_capture_members): Don't clear IDENTIFIER_MARKED here. * g++.dg/cpp1y/lambda-init18.C: New test. * g++.dg/cpp1y/lambda-init19.C: New test. * g++.dg/cpp1y/pr89767.C: New test. From-SVN: r269860
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r--gcc/cp/lambda.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index e7f0fda..3e17676 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -601,19 +601,6 @@ add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p,
IDENTIFIER_LENGTH (id) + 1);
name = get_identifier (buf);
- /* If TREE_TYPE isn't set, we're still in the introducer, so check
- for duplicates. */
- if (!LAMBDA_EXPR_CLOSURE (lambda))
- {
- if (IDENTIFIER_MARKED (name))
- {
- pedwarn (input_location, 0,
- "already captured %qD in lambda expression", id);
- return NULL_TREE;
- }
- IDENTIFIER_MARKED (name) = true;
- }
-
if (variadic)
type = make_pack_expansion (type);
@@ -674,8 +661,6 @@ register_capture_members (tree captures)
if (PACK_EXPANSION_P (field))
field = PACK_EXPANSION_PATTERN (field);
- /* We set this in add_capture to avoid duplicates. */
- IDENTIFIER_MARKED (DECL_NAME (field)) = false;
finish_member_declaration (field);
}