aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2024-08-06 09:34:02 -0400
committerMarek Polacek <polacek@redhat.com>2024-08-06 13:14:02 -0400
commit68e269092ee405832998b735a796c1953039d5f3 (patch)
tree3254adb19dad24204004545a4bef0b299424513a /gcc/cp
parentb2a8ee0e5d8cfa92bafd0db4b03626b26ac21948 (diff)
downloadgcc-68e269092ee405832998b735a796c1953039d5f3.zip
gcc-68e269092ee405832998b735a796c1953039d5f3.tar.gz
gcc-68e269092ee405832998b735a796c1953039d5f3.tar.bz2
c++: further concept_check_p clean-up
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.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/constexpr.cc20
-rw-r--r--gcc/cp/cp-gimplify.cc9
-rw-r--r--gcc/cp/except.cc2
3 files changed, 6 insertions, 25 deletions
diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc
index 8d994f0..b0adbb9 100644
--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -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))
{
diff --git a/gcc/cp/cp-gimplify.cc b/gcc/cp/cp-gimplify.cc
index 0c589ee..003e68f 100644
--- a/gcc/cp/cp-gimplify.cc
+++ b/gcc/cp/cp-gimplify.cc
@@ -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)))
diff --git a/gcc/cp/except.cc b/gcc/cp/except.cc
index 3c69ab6..0231bd2 100644
--- a/gcc/cp/except.cc
+++ b/gcc/cp/except.cc
@@ -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);