]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: further concept_check_p clean-up
authorMarek Polacek <polacek@redhat.com>
Tue, 6 Aug 2024 13:34:02 +0000 (09:34 -0400)
committerMarek Polacek <polacek@redhat.com>
Tue, 6 Aug 2024 17:14:02 +0000 (13:14 -0400)
Patrick noticed a few more concept_check_p checks that can be removed
now.

gcc/cp/ChangeLog:

* constexpr.cc (cxx_eval_call_expression): Remove concept_check_p check.
(cxx_eval_outermost_constant_expr): Likewise.
* cp-gimplify.cc (cp_genericize_r) <case CALL_EXPR>: Likewise.
* except.cc (check_noexcept_r): Likewise.

gcc/cp/constexpr.cc
gcc/cp/cp-gimplify.cc
gcc/cp/except.cc

index 8d994f0ee536b35838adda593863834bed05262c..b0adbb9036d92f5b41d5f0d92152603211596129 100644 (file)
@@ -2797,10 +2797,6 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
                          value_cat lval,
                          bool *non_constant_p, bool *overflow_p)
 {
-  /* Handle concept checks separately.  */
-  if (concept_check_p (t))
-    return evaluate_concept_check (t);
-
   location_t loc = cp_expr_loc_or_input_loc (t);
   tree fun = get_function_named_in_call (t);
   constexpr_call new_call
@@ -8774,16 +8770,12 @@ cxx_eval_outermost_constant_expr (tree t, bool allow_non_constant,
               || TREE_CODE (t) == AGGR_INIT_EXPR
               || TREE_CODE (t) == TARGET_EXPR))
     {
-      /* For non-concept checks, determine if it is consteval.  */
-      if (!concept_check_p (t))
-       {
-         tree x = t;
-         if (TREE_CODE (x) == TARGET_EXPR)
-           x = TARGET_EXPR_INITIAL (x);
-         tree fndecl = cp_get_callee_fndecl_nofold (x);
-         if (fndecl && DECL_IMMEDIATE_FUNCTION_P (fndecl))
-           is_consteval = true;
-       }
+      tree x = t;
+      if (TREE_CODE (x) == TARGET_EXPR)
+       x = TARGET_EXPR_INITIAL (x);
+      tree fndecl = cp_get_callee_fndecl_nofold (x);
+      if (fndecl && DECL_IMMEDIATE_FUNCTION_P (fndecl))
+       is_consteval = true;
     }
   if (AGGREGATE_TYPE_P (type) || VECTOR_TYPE_P (type))
     {
index 0c589eeaaec4e062b63fa54343fd6b9b265a4b28..003e68f1ea725d2998bc965344bf68093b5c3817 100644 (file)
@@ -2092,15 +2092,6 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
       break;
 
     case CALL_EXPR:
-      /* Evaluate function concept checks instead of treating them as
-        normal functions.  */
-      if (concept_check_p (stmt))
-       {
-         *stmt_p = evaluate_concept_check (stmt);
-         * walk_subtrees = 0;
-         break;
-       }
-
       if (!wtd->no_sanitize_p
          && sanitize_flags_p ((SANITIZE_NULL
                                | SANITIZE_ALIGNMENT | SANITIZE_VPTR)))
index 3c69ab6950283295471a8ea7f45154fa498e4ffa..0231bd2507d585dc1c2ee7cdd437ff1600816994 100644 (file)
@@ -1074,8 +1074,6 @@ check_noexcept_r (tree *tp, int *walk_subtrees, void *)
 
          We could use TREE_NOTHROW (t) for !TREE_PUBLIC fns, though... */
       tree fn = cp_get_callee (t);
-      if (concept_check_p (fn))
-       return NULL_TREE;
       tree type = TREE_TYPE (fn);
       gcc_assert (INDIRECT_TYPE_P (type));
       type = TREE_TYPE (type);