]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lambda.c (is_capture_proxy_with_ref): Remove.
authorJason Merrill <jason@redhat.com>
Wed, 7 Mar 2018 21:04:18 +0000 (16:04 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 7 Mar 2018 21:04:18 +0000 (16:04 -0500)
* lambda.c (is_capture_proxy_with_ref): Remove.

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

From-SVN: r258341

gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/cp-tree.h
gcc/cp/expr.c
gcc/cp/lambda.c
gcc/cp/semantics.c

index ac7bd4b749e8d06bf73ed9f88191f1d275f57ffe..9dd7c179710572dec1fc10238826e067958c12bf 100644 (file)
@@ -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
index bd53bfbfe4730893413c27143782f4467f90ee7d..2c5a71f3ee5635e63fb3457694d94ff2c2909a49 100644 (file)
@@ -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
index 17d8c6d2650a18c7fa4e98a0df105507f3461c9a..190286dceddb26ce2d2e5c4ba16c74dc316d740a 100644 (file)
@@ -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);
index b2c8cfaf88c7ee1f0620ef60cd059e8fb8eaa96f..2e67986897061d27bbd4b368af888025d76988d6 100644 (file)
@@ -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);
index 345b210e89c857ec606da0a0395b235f8b23421c..094979e81a3bd4be34b2009f84daef3bfa3be0a3 100644 (file)
@@ -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)
index 8a0096ddf923fd5e951de86f2e84de4c71f23e8b..bb8b5953539ef1a64f8049ea037e0632362bc0ee 100644 (file)
@@ -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);