aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorAndrew Sutton <asutton@lock3software.com>2019-11-27 14:02:49 +0000
committerAndrew Sutton <asutton@gcc.gnu.org>2019-11-27 14:02:49 +0000
commit1906392b2c9a02da82d1739386219ec0f13bcc33 (patch)
treea7fc0e30e92fb6d419ec84c49136bf5c86cd753d /gcc/cp/semantics.c
parent45a454883eef8acbdad75c0f376aaf22ec7416ff (diff)
downloadgcc-1906392b2c9a02da82d1739386219ec0f13bcc33.zip
gcc-1906392b2c9a02da82d1739386219ec0f13bcc33.tar.gz
gcc-1906392b2c9a02da82d1739386219ec0f13bcc33.tar.bz2
Diagnose certain constraint errors as hard errors, but otherwise treat them the same as normal SFINAE-type errors.
2019-11-27 Andrew Sutton <asutton@lock3software.com> Diagnose certain constraint errors as hard errors, but otherwise treat them the same as normal SFINAE-type errors. Also, generally clean up the satisfaction functions. gcc/cp/ * constexpr.c (cxx_eval_constant_expression): Use evaluate_concept_check. * constraint.cc (normalize_concept_definition): Accept a diagnostic flag and only cache when not diagnosing errors. (decl_satisfied_cache): Map to trees instead of bools. (satisfy_atom): Guarantee a location for the errors, propagate complain flags to force_rvalue, and emit errors for non-boolean constraints. (get_normalized_constraints_and_args): New overloads. Factored out of satisfy_constraint_expression and satisfy_declaration_constraints. (satisfy_constraint_expression): Propagate diagnostic info to normalization. (satisfy_declaration_constraints): New. Factored out of constraints_satisfied_p. (constraint_satisfaction_value): New. Calls satisfy_constraint_expression or satisfy_declaration_constraints. (constraints_satisfied_p): Call constraint_satisfaction_value. (evaluate_concept_check): Don't take tsubst_falgs_t. Replay satisfaction if an error is encountered. (current_failed_constraint): Moved from pt.c. (diagnose_constraints): Call constraint_satisfaction_value. * cp-tree.h: Update declarations. * pt.c (current_failed_constraint): Moved to constraint.cc. * semantics.c (finish_id_expression_1): Remove a duplicate case. gcc/testsuite/ * g++.dg/concepts/pr84330.C: Update diagnostics. * g++.dg/cpp2a/concepts-requires2.C: Likewise. From-SVN: r278768
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 16180f5..6c4785c 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -3970,16 +3970,6 @@ finish_id_expression_1 (tree id_expression,
decl = baselink_for_fns (decl);
}
- else if (concept_check_p (decl))
- {
- /* If this is a standard or variable concept check, potentially
- evaluate it. Function concepts need to be called as functions,
- so don't try evaluating them here. */
- tree tmpl = TREE_OPERAND (decl, 0);
- tree args = TREE_OPERAND (decl, 1);
- if (!function_concept_p (tmpl) && !uses_template_parms (args))
- decl = evaluate_concept_check (decl, tf_warning_or_error);
- }
else
{
if (DECL_P (decl) && DECL_NONLOCAL (decl)