diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-03-07 21:04:18 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-03-07 21:04:18 +0000 |
commit | d0e2b7e7303a5399540da4ffa19078a36891d13b (patch) | |
tree | 8b0543de41823257bb455e6cdfe52c7a6d57af69 | |
parent | 93d9caaf651b314359bc4b36f7c981a625e19bab (diff) | |
download | gcc-d0e2b7e7303a5399540da4ffa19078a36891d13b.tar.gz |
* lambda.c (is_capture_proxy_with_ref): Remove.
* constexpr.c, expr.c, cp-tree.h, semantics.c: Adjust.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@258341 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/constexpr.c | 2 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 1 | ||||
-rw-r--r-- | gcc/cp/expr.c | 4 | ||||
-rw-r--r-- | gcc/cp/lambda.c | 13 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 2 |
6 files changed, 10 insertions, 17 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ac7bd4b749e..9dd7c179710 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-03-06 Jason Merrill <jason@redhat.com> + + * lambda.c (is_capture_proxy_with_ref): Remove. + * constexpr.c, expr.c, cp-tree.h, semantics.c: Adjust. + 2018-03-06 Marek Polacek <polacek@redhat.com> PR c++/84684 diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index bd53bfbfe47..2c5a71f3ee5 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -5429,7 +5429,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now, case VAR_DECL: if (DECL_HAS_VALUE_EXPR_P (t)) { - if (now && is_capture_proxy_with_ref (t)) + if (now && is_normal_capture_proxy (t)) { /* -- in a lambda-expression, a reference to this or to a variable with automatic storage duration defined outside that diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 17d8c6d2650..190286dcedd 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -6895,7 +6895,6 @@ extern void insert_capture_proxy (tree); extern void insert_pending_capture_proxies (void); extern bool is_capture_proxy (tree); extern bool is_normal_capture_proxy (tree); -extern bool is_capture_proxy_with_ref (tree); extern void register_capture_members (tree); extern tree lambda_expr_this_capture (tree, bool); extern void maybe_generic_this_capture (tree, tree); diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c index b2c8cfaf88c..2e679868970 100644 --- a/gcc/cp/expr.c +++ b/gcc/cp/expr.c @@ -111,7 +111,7 @@ mark_use (tree expr, bool rvalue_p, bool read_p, { case VAR_DECL: case PARM_DECL: - if (rvalue_p && is_capture_proxy_with_ref (expr)) + if (rvalue_p && is_normal_capture_proxy (expr)) { /* Look through capture by copy. */ tree cap = DECL_CAPTURED_VARIABLE (expr); @@ -154,7 +154,7 @@ mark_use (tree expr, bool rvalue_p, bool read_p, { /* Try to look through the reference. */ tree ref = TREE_OPERAND (expr, 0); - if (rvalue_p && is_capture_proxy_with_ref (ref)) + if (rvalue_p && is_normal_capture_proxy (ref)) { /* Look through capture by reference. */ tree cap = DECL_CAPTURED_VARIABLE (ref); diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 345b210e89c..094979e81a3 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -291,24 +291,13 @@ is_normal_capture_proxy (tree decl) return DECL_NORMAL_CAPTURE_P (val); } -/* Returns true iff DECL is a capture proxy for which we can use - DECL_CAPTURED_VARIABLE. In effect, this is a normal proxy other than a - nested capture of a function parameter pack. */ - -bool -is_capture_proxy_with_ref (tree var) -{ - return (is_normal_capture_proxy (var) && DECL_LANG_SPECIFIC (var) - && DECL_CAPTURED_VARIABLE (var)); -} - /* VAR is a capture proxy created by build_capture_proxy; add it to the current function, which is the operator() for the appropriate lambda. */ void insert_capture_proxy (tree var) { - if (is_capture_proxy_with_ref (var)) + if (is_normal_capture_proxy (var)) { tree cap = DECL_CAPTURED_VARIABLE (var); if (CHECKING_P) diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 8a0096ddf92..bb8b5953539 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -3332,7 +3332,7 @@ process_outer_var_ref (tree decl, tsubst_flags_t complain, bool odr_use) { /* Check whether we've already built a proxy. */ tree var = decl; - while (is_capture_proxy_with_ref (var)) + while (is_normal_capture_proxy (var)) var = DECL_CAPTURED_VARIABLE (var); tree d = retrieve_local_specialization (var); |