public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-contracts] c++: disable constexpr assume contract special handling
@ 2022-10-17 21:16 Jason Merrill
0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2022-10-17 21:16 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:61b1ec945d6ec8a7580980507f732789b0f8ca87
commit 61b1ec945d6ec8a7580980507f732789b0f8ca87
Author: Jason Merrill <jason@redhat.com>
Date: Mon Oct 17 15:58:03 2022 -0400
c++: disable constexpr assume contract special handling
This code was trying to avoid instantiating for an assumed contract, but the
instantiation in contracts-assume6.C was happening earlier. Now it doesn't,
but the testcase still expects it. So disable this code for now.
gcc/cp/ChangeLog:
* constexpr.cc (cxx_eval_constant_expression): Don't try to avoid
instantiation for CCS_ASSUME.
Diff:
---
gcc/cp/constexpr.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc
index 09267e538a8..57617847634 100644
--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -7740,11 +7740,14 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
tree c = CONTRACT_CONDITION (t);
if (semantic == CCS_ASSUME)
{
+#if 0
/* For an assume contract, try evaluating it without instantiating
anything. If non-constant, assume it's satisfied. */
+ /* This breaks contracts-assume6.C. */
if (!cp_tree_defined_p (c))
break;
+#endif
bool dummy_nc = false, dummy_ov = false;
constexpr_ctx new_ctx = *ctx;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-17 21:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17 21:16 [gcc/devel/c++-contracts] c++: disable constexpr assume contract special handling Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).