aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-gimplify.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/cp-gimplify.c')
-rw-r--r--gcc/cp/cp-gimplify.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 6076697..7942afa 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -1622,6 +1622,15 @@ 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, tf_warning_or_error);
+ * walk_subtrees = 0;
+ break;
+ }
+
if (!wtd->no_sanitize_p
&& sanitize_flags_p ((SANITIZE_NULL
| SANITIZE_ALIGNMENT | SANITIZE_VPTR)))
@@ -1679,6 +1688,13 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
TARGET_EXPR_NO_ELIDE (stmt) = 1;
break;
+ case TEMPLATE_ID_EXPR:
+ gcc_assert (concept_check_p (stmt));
+ /* Emit the value of the concept check. */
+ *stmt_p = evaluate_concept_check (stmt, tf_warning_or_error);
+ walk_subtrees = 0;
+ break;
+
default:
if (IS_TYPE_OR_DECL_P (stmt))
*walk_subtrees = 0;