Commit 68ad1bf7 by Jason Merrill Committed by Jason Merrill

lambda.c (is_capture_proxy_with_ref): Remove.

	* lambda.c (is_capture_proxy_with_ref): Remove.

	* constexpr.c, expr.c, cp-tree.h, semantics.c: Adjust.

From-SVN: r258341
parent 335b7b5a
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> 2018-03-06 Marek Polacek <polacek@redhat.com>
PR c++/84684 PR c++/84684
......
...@@ -5429,7 +5429,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now, ...@@ -5429,7 +5429,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
case VAR_DECL: case VAR_DECL:
if (DECL_HAS_VALUE_EXPR_P (t)) 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 /* -- in a lambda-expression, a reference to this or to a
variable with automatic storage duration defined outside that variable with automatic storage duration defined outside that
......
...@@ -6895,7 +6895,6 @@ extern void insert_capture_proxy (tree); ...@@ -6895,7 +6895,6 @@ extern void insert_capture_proxy (tree);
extern void insert_pending_capture_proxies (void); extern void insert_pending_capture_proxies (void);
extern bool is_capture_proxy (tree); extern bool is_capture_proxy (tree);
extern bool is_normal_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 void register_capture_members (tree);
extern tree lambda_expr_this_capture (tree, bool); extern tree lambda_expr_this_capture (tree, bool);
extern void maybe_generic_this_capture (tree, tree); extern void maybe_generic_this_capture (tree, tree);
......
...@@ -111,7 +111,7 @@ mark_use (tree expr, bool rvalue_p, bool read_p, ...@@ -111,7 +111,7 @@ mark_use (tree expr, bool rvalue_p, bool read_p,
{ {
case VAR_DECL: case VAR_DECL:
case PARM_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. */ /* Look through capture by copy. */
tree cap = DECL_CAPTURED_VARIABLE (expr); tree cap = DECL_CAPTURED_VARIABLE (expr);
...@@ -154,7 +154,7 @@ mark_use (tree expr, bool rvalue_p, bool read_p, ...@@ -154,7 +154,7 @@ mark_use (tree expr, bool rvalue_p, bool read_p,
{ {
/* Try to look through the reference. */ /* Try to look through the reference. */
tree ref = TREE_OPERAND (expr, 0); 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. */ /* Look through capture by reference. */
tree cap = DECL_CAPTURED_VARIABLE (ref); tree cap = DECL_CAPTURED_VARIABLE (ref);
......
...@@ -291,24 +291,13 @@ is_normal_capture_proxy (tree decl) ...@@ -291,24 +291,13 @@ is_normal_capture_proxy (tree decl)
return DECL_NORMAL_CAPTURE_P (val); 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 /* VAR is a capture proxy created by build_capture_proxy; add it to the
current function, which is the operator() for the appropriate lambda. */ current function, which is the operator() for the appropriate lambda. */
void void
insert_capture_proxy (tree var) insert_capture_proxy (tree var)
{ {
if (is_capture_proxy_with_ref (var)) if (is_normal_capture_proxy (var))
{ {
tree cap = DECL_CAPTURED_VARIABLE (var); tree cap = DECL_CAPTURED_VARIABLE (var);
if (CHECKING_P) if (CHECKING_P)
......
...@@ -3332,7 +3332,7 @@ process_outer_var_ref (tree decl, tsubst_flags_t complain, bool odr_use) ...@@ -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. */ /* Check whether we've already built a proxy. */
tree var = decl; tree var = decl;
while (is_capture_proxy_with_ref (var)) while (is_normal_capture_proxy (var))
var = DECL_CAPTURED_VARIABLE (var); var = DECL_CAPTURED_VARIABLE (var);
tree d = retrieve_local_specialization (var); tree d = retrieve_local_specialization (var);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment