public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jason Merrill <jason@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/c++-contracts] c++: disable constexpr assume contract special handling Date: Mon, 17 Oct 2022 21:16:53 +0000 (GMT) [thread overview] Message-ID: <20221017211653.3E5583858295@sourceware.org> (raw) 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;
reply other threads:[~2022-10-17 21:16 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20221017211653.3E5583858295@sourceware.org \ --to=jason@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).