From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11866 invoked by alias); 21 Dec 2018 19:31:21 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 11855 invoked by uid 89); 21 Dec 2018 19:31:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=Hx-languages-length:968 X-HELO: mail-qt1-f195.google.com Received: from mail-qt1-f195.google.com (HELO mail-qt1-f195.google.com) (209.85.160.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Dec 2018 19:31:19 +0000 Received: by mail-qt1-f195.google.com with SMTP id l11so6958763qtp.0 for ; Fri, 21 Dec 2018 11:31:19 -0800 (PST) Return-Path: Received: from [192.168.1.149] (209-6-216-142.s141.c3-0.smr-cbr1.sbo-smr.ma.cable.rcncustomer.com. [209.6.216.142]) by smtp.gmail.com with ESMTPSA id a185sm5267392qkb.1.2018.12.21.11.31.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Dec 2018 11:31:16 -0800 (PST) Subject: Re: [C++ PATCH] Fix __builtin_{is_constant_evaluated,constant_p} handling in static_assert (PR c++/86524, PR c++/88446, take 2) To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org References: <20181212223037.GL12380@tucnak> <310c40c2-ee1c-8a96-0e09-098ffbb1dba1@redhat.com> <20181220210812.GQ23305@tucnak> <20181220214035.GR23305@tucnak> <20181220222719.GS23305@tucnak> <4abcfe78-7e84-5188-6616-ddba47d9a5bd@redhat.com> <20181221085141.GV23305@tucnak> From: Jason Merrill Message-ID: <1fa985da-e362-4d1d-c05c-33dca08b26b2@redhat.com> Date: Fri, 21 Dec 2018 19:31:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181221085141.GV23305@tucnak> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg01603.txt.bz2 On 12/21/18 3:51 AM, Jakub Jelinek wrote: > On Thu, Dec 20, 2018 at 09:49:39PM -0500, Jason Merrill wrote: >>> But if we need cp_fully_fold, doesn't that mean that the earlier >>> cxx_eval_constant_expression failed and thus the argument is not a constant >>> expression? Should __builtin_is_constant_evaluated () evaluate to true >>> even if the argument is not a constant expression? >> >> Ah, no, good point. >> >>> Is there a reason to call that maybe_constant_value at all when we've called >>> cxx_eval_constant_expression first? Wouldn't cp_fold_rvalue (or >>> c_fully_fold with false as last argument) be sufficient there? >> >> I think that would be better, yes. > > As cp_fold_rvalue* is static in cp-gimplify.c, I've used c_fully_fold > (or do you want to export cp_fold_rvalue*?). Let's export it. OK with that change. Jason