public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: gcc-patches@gcc.gnu.org
Subject: [pushed] c++: correct fold_operand change
Date: Tue, 25 Oct 2022 14:05:06 -0400	[thread overview]
Message-ID: <20221025180506.108938-1-jason@redhat.com> (raw)
In-Reply-To: <20221025163709.95817-1-jason@redhat.com>

Tested x86_64-pc-linux-gnu, applying to trunk.

-- >8 --

Still want the conversion to bool.

gcc/cp/ChangeLog:

	* constexpr.cc (find_failing_clause_r): Re-add the call to
	contextual_conv_bool.
---
 gcc/cp/constexpr.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc
index 39bb023b79c..15b4f2c4a08 100644
--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -1887,7 +1887,8 @@ find_failing_clause_r (const constexpr_ctx *ctx, tree expr)
 	e = find_failing_clause_r (ctx, TREE_OPERAND (expr, 1));
       return e;
     }
-  tree e = fold_operand (expr, ctx);
+  tree e = contextual_conv_bool (expr, tf_none);
+  e = fold_operand (e, ctx);
   if (integer_zerop (e))
     /* This is the failing clause.  */
     return expr;

base-commit: e6a29aab51122103e677ffed523371c9c816ec98
-- 
2.31.1


      reply	other threads:[~2022-10-25 18:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25 16:37 [pushed] c++: improve failed constexpr assume diagnostic Jason Merrill
2022-10-25 18:05 ` Jason Merrill [this message]

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=20221025180506.108938-1-jason@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@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: link
Be 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).