From patchwork Tue Oct 25 18:05:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 10914 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1144496wru; Tue, 25 Oct 2022 11:06:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM60qxMK+VAG7HQmphNGa5j4s9zzr/ypJOtlCXkiMAMxuZnV79AkFOyI8e8HFe5/6gjhT3Io X-Received: by 2002:a05:6402:2552:b0:45d:ecf:b23 with SMTP id l18-20020a056402255200b0045d0ecf0b23mr37272329edb.255.1666721179732; Tue, 25 Oct 2022 11:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666721179; cv=none; d=google.com; s=arc-20160816; b=Vg2YKRmuGc/JNyaie9xaHhCVQzl6sTme+nBFIl4FfwATn/Y8UPVcmPYRcsC1kl4zgC LCl+8lPMqvQjNhG9ztQ4nfdYiOs6UganFRX1MHHCjIWbc1AAL0if+PK5uW02UOuSH229 BL4PC7eGVw+LESpKhFSOT7vjyJjjm2uXK0Xr6OENkSkoIBqRkMWyJmsCklPeW8KMJ/uj OTgjGi/5o82yDlkr711l8UlJMtetj3wh5qrAPqpHFFnChmishiehupB5WR1k9Qx44/dH F+DCw/cbkyHWu/V+v5MKbMfA9a4lZgdCpxAY9W6oRhpWXFaqYyE2eso1aD/v9vCsldUe Z+hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=lORKuAJlcgRnBwHVZDoIAkzGMDfRNEeUbHVlVZ8Mt1w=; b=YQI1shxDUVF9GK8JyTxD9XYHGvWvbE/fhyH/xr3IBBOABy8d1qevxas24LZXubvGHk yRTclLdgqzVZzNykDRUn6Wj4I8mgMQ5HcqGNEhjiFR645rXDJ2RIUrhTbtwxast7m6xy 12eLzlGwObCInTs2PGZIT7qE1AKzlKhWQxvVsfWFPe8+9sh2yufTSmpUbQNa8BBE5i7Y uESaIwAxtxW2tW7o9x7g94fEQ9DjxNL+CnuXugxLY0esUYqL8vmNVI+AReIjnEmNwLpF Rg0XoDMkN30RR++3ttp+VmI6jVd6NnJUjL7VEhjKUeiUefdXCkrExMWhq7SmGbAvMuLH gODQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=y6T4spe8; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id dp21-20020a170906c15500b007ac60b83407si2855384ejc.725.2022.10.25.11.06.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 11:06:19 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=y6T4spe8; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C5DB33858402 for ; Tue, 25 Oct 2022 18:06:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5DB33858402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666721178; bh=lORKuAJlcgRnBwHVZDoIAkzGMDfRNEeUbHVlVZ8Mt1w=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=y6T4spe8UVmLIv6Z+qXPdJLdeiVuCUpGFz845HPj07w63UDB/68zlgHQZQ4V41aYc PdYAdt/bY6SphSZj1gniVf7AYevBZEhjoNia3zmLxf8NmaqgU+IUnCw0aYlJB80aWw X6EG8d2u6RRvNLr/XgsUrw41GeKBzvkKspQEVQ24= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 436FB3858402 for ; Tue, 25 Oct 2022 18:05:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 436FB3858402 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-290-o5eIArCxPQKA-VjmdijLLA-1; Tue, 25 Oct 2022 14:05:10 -0400 X-MC-Unique: o5eIArCxPQKA-VjmdijLLA-1 Received: by mail-qk1-f197.google.com with SMTP id f12-20020a05620a408c00b006ced53b80e5so12143923qko.17 for ; Tue, 25 Oct 2022 11:05:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lORKuAJlcgRnBwHVZDoIAkzGMDfRNEeUbHVlVZ8Mt1w=; b=IsxGh/9ZuM6RgOOxeKO9MsYPtUYsjsvOoLjWo0vSQLzPbxKyqyznjMnJhZEFGm6kKa OQQa9UQ30IkHUx9H/lKbxg0iaHrzDuvhTN4LnLpFGxFL+Vwrn4zLZdUfRvOszwwgR4Jx loEJ1YK+6p9CCRdowAMQ4BBOBWnfNJ3gZvCCxk1H82ZYjqZe6dGNeqFjfa+w97GWZrXA vn8LwyZorzQZKWN3XDRUX5wIACarZsRLbjSLNr+wRdP6mbszj9fJEhGAV8JGGevK/161 ylS68RF4XILRO4KtCmaiP0yxngU4gdZN/XpiEo33eTSlUdG7L56LO3gef+BWo5lgjhij daUg== X-Gm-Message-State: ACrzQf0PQid7PZui5SHJI+zCyYt7EDJxn8mF8cPFI9xRnD5BFu4P2OJz NZjMveWodmuQE1YbH5tLphrONbRgXWUqkvWFm5MIlj5EgWXRNnHz/dhDQFfij+Jk8lAVTWy1iUN bgrAbk/SPGYtn+jC/WIBupjjOMdO7B5ejywKQ6KuRIoWJFReYZ4bbT9NkL+etCCYzEg== X-Received: by 2002:a05:622a:1ba7:b0:39c:e770:2809 with SMTP id bp39-20020a05622a1ba700b0039ce7702809mr33422473qtb.423.1666721109779; Tue, 25 Oct 2022 11:05:09 -0700 (PDT) X-Received: by 2002:a05:622a:1ba7:b0:39c:e770:2809 with SMTP id bp39-20020a05622a1ba700b0039ce7702809mr33422434qtb.423.1666721109331; Tue, 25 Oct 2022 11:05:09 -0700 (PDT) Received: from barrymore.redhat.com (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id a25-20020a05620a16d900b006b615cd8c13sm2270989qkn.106.2022.10.25.11.05.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 11:05:08 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: correct fold_operand change Date: Tue, 25 Oct 2022 14:05:06 -0400 Message-Id: <20221025180506.108938-1-jason@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221025163709.95817-1-jason@redhat.com> References: <20221025163709.95817-1-jason@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jason Merrill via Gcc-patches From: Jason Merrill Reply-To: Jason Merrill Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747683827968135347?= X-GMAIL-MSGID: =?utf-8?q?1747683827968135347?= 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(-) base-commit: e6a29aab51122103e677ffed523371c9c816ec98 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;