From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 75DDF3835416 for ; Thu, 10 Jun 2021 10:25:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 75DDF3835416 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-113-_RzEruy1MUGYHaM5wfqnOQ-1; Thu, 10 Jun 2021 06:24:56 -0400 X-MC-Unique: _RzEruy1MUGYHaM5wfqnOQ-1 Received: by mail-wr1-f69.google.com with SMTP id x9-20020a5d49090000b0290118d8746e06so675655wrq.10 for ; Thu, 10 Jun 2021 03:24:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kR7brAowE1qH084n9HFNmEatTYKO3dPvJSooqNJiCHc=; b=sqF/r6o7lgx4klJdNa84azt3wvObLFnIZUIvcIAcWjgJAfeJ5V8CfP/WN+suTc/60/ 275gCMJNt0SkhFCAdamBkl1BaX3PXwrRLA70vsd+DXqLFkDABjkO4n363dZFBuekWnkS tMc48IxEFD3XdN8qm7AxIV306+g1zJzvZTk6AuybkP6eElmMKyBK+YPYjE30xjTN2+jP xOKNg0FjR/KZo5HOARhLYthxS9Dk2KXuKK3gtlUcB1uO4FX565YykMr4K3kauy7F9Vy4 GJZEIm59fpxqTO5H6RnKouijxImArqfoQEviVe2xGz63c4FRmDEwbfbvX611we6LZ2Ge yLbA== X-Gm-Message-State: AOAM5303civlFWg1WEbdmOBj7bDK1wOlim492OCWiZbMqqDT9nQivkjx q9CwMa24TUXg7e6TpX2E7aeSsZRn29F8f2f8l35H830bQkODWKCgrwF8v3OaDxRVtkaBrpRxkuZ NVTzgpPvQDB4KCzFaHl/dWW3c/utqc150cw== X-Received: by 2002:a1c:98d0:: with SMTP id a199mr14429087wme.22.1623320695071; Thu, 10 Jun 2021 03:24:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIAjgpPKr9Ve3HhQEES6LERDzTJByCGYLBOoJmwW4BdjicwlhBMZutfotSvus5uZQrqovJhw5fj82nzCX0kQE= X-Received: by 2002:a1c:98d0:: with SMTP id a199mr14429074wme.22.1623320694867; Thu, 10 Jun 2021 03:24:54 -0700 (PDT) MIME-Version: 1.0 References: <20210610083416.GC7746@tucnak> In-Reply-To: <20210610083416.GC7746@tucnak> From: Jonathan Wakely Date: Thu, 10 Jun 2021 11:24:43 +0100 Message-ID: Subject: Re: [PATCH] c++: Add C++23 consteval if support - P1938R3 [PR100974] To: Jakub Jelinek Cc: Jason Merrill , gcc Patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Thu, 10 Jun 2021 10:25:02 -0000 On Thu, 10 Jun 2021 at 09:34, Jakub Jelinek wrote: > Also, the paper doesn't contain the exact __cpp_if_consteval value, Right, proposals aren't supposed to, because the value gets set when the proposal is voted into the working draft (which the proposal author doesn't control). > but https://github.com/cplusplus/draft/pull/4660/files mentions 202106L > which this patch uses. That's the right value. > And I'm not changing the libstdc++ side, where perhaps we could change > std::is_constant_evaluated definition for > #ifdef __cpp_if_consteval > case to if consteval { return true; } else { return false; } > but we need to keep it defined to __builtin_is_constant_evaluated () > for C++20 or older. Is there any advantage to changing that (cheaper for GCC to evaluate?) or should we just continue to use the __builtin unconditionally? I suppose it's theoretically possible that there could be a non-GCC compiler where defined(__cpp_if_consteval) is true but __has_builtin(__builtin_is_constant_evaluated) is false.