aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2017-09-28 15:39:45 -0400
committerJason Merrill <jason@gcc.gnu.org>2017-09-28 15:39:45 -0400
commit281e6c1d8f1b4ca552d8ce2276ddecfcd6ffb15e (patch)
tree4ec4cc5dfce6282bcbc8d1adfbbb092073395b53 /gcc/cp/init.c
parent5c263e84ab7e5df28a9055ae533c2d305f4b7b3d (diff)
downloadgcc-281e6c1d8f1b4ca552d8ce2276ddecfcd6ffb15e.zip
gcc-281e6c1d8f1b4ca552d8ce2276ddecfcd6ffb15e.tar.gz
gcc-281e6c1d8f1b4ca552d8ce2276ddecfcd6ffb15e.tar.bz2
PR c++/56973, DR 696 - capture constant variables only as needed.
* expr.c (mark_use): Split out from mark_rvalue_use and mark_lvalue_use. Handle lambda capture of constant variables. (mark_lvalue_use_nonread): New. * semantics.c (process_outer_var_ref): Don't capture a constant variable until forced. * pt.c (processing_nonlambda_template): New. * call.c (build_this): Check it. * decl2.c (grok_array_decl): Call mark_rvalue_use and mark_lvalue_use_nonread. * init.c (constant_value_1): Don't call mark_rvalue_use. * typeck.c (build_static_cast): Handle lambda capture. From-SVN: r253266
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index b01d662..4bc0755 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -2213,7 +2213,6 @@ constant_value_1 (tree decl, bool strict_p, bool return_aggregate_cst_ok_p)
initializer for the static data member is not processed
until needed; we need it now. */
mark_used (decl, tf_none);
- mark_rvalue_use (decl);
init = DECL_INITIAL (decl);
if (init == error_mark_node)
{