diff options
author | Ville Voutilainen <ville.voutilainen@gmail.com> | 2014-05-21 20:23:07 +0300 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-05-21 13:23:07 -0400 |
commit | 174ebf656274b6119c13a730294241fd5c0efb55 (patch) | |
tree | b28d4b0e943b01ef3b9e2d54ae03b3227bb78251 /gcc/cp/lambda.c | |
parent | 2acb1027924f91e900964b529719efcdc1aacfac (diff) | |
download | gcc-174ebf656274b6119c13a730294241fd5c0efb55.zip gcc-174ebf656274b6119c13a730294241fd5c0efb55.tar.gz gcc-174ebf656274b6119c13a730294241fd5c0efb55.tar.bz2 |
re PR c++/61133 (g++ doesn't implement DR1760)
PR c++/61133
* lambda.c (build_capture_proxy, add_capture): Treat normal
captures and init-captures identically.
From-SVN: r210720
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 3ce9ebb..bb6014b 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -367,10 +367,7 @@ build_capture_proxy (tree member) object = TREE_OPERAND (object, 0); /* Remove the __ inserted by add_capture. */ - if (DECL_NORMAL_CAPTURE_P (member)) - name = get_identifier (IDENTIFIER_POINTER (DECL_NAME (member)) + 2); - else - name = DECL_NAME (member); + name = get_identifier (IDENTIFIER_POINTER (DECL_NAME (member)) + 2); type = lambda_proxy_type (object); @@ -500,17 +497,11 @@ add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p, won't find the field with name lookup. We can't just leave the name unset because template instantiation uses the name to find instantiated fields. */ - if (!explicit_init_p) - { - buf = (char *) alloca (IDENTIFIER_LENGTH (id) + 3); - buf[1] = buf[0] = '_'; - memcpy (buf + 2, IDENTIFIER_POINTER (id), - IDENTIFIER_LENGTH (id) + 1); - name = get_identifier (buf); - } - else - /* But captures with explicit initializers are named. */ - name = id; + buf = (char *) alloca (IDENTIFIER_LENGTH (id) + 3); + buf[1] = buf[0] = '_'; + memcpy (buf + 2, IDENTIFIER_POINTER (id), + IDENTIFIER_LENGTH (id) + 1); + name = get_identifier (buf); /* If TREE_TYPE isn't set, we're still in the introducer, so check for duplicates. */ |