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 [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 8BF263948A79 for ; Wed, 16 Nov 2022 00:27:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8BF263948A79 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668558436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6B5zmJzGsBPfzhB/eaZE3rP0Ip1lxgaCkHFRucwCRbI=; b=F+BJVMQ/QJt1poh4h1Z4pBRuePX5XwpB7/gbzikKNAem/Rp4g/rk4F7iCZNiZFC9xcD2oy FBZwnYSTVS/ut0kF8FuTsE8VAws57wn75EPDxO/H9mtXraM1c0dSJfRIwVYpZ5VrZSIvZR xq+NLRnuk3O2KzXTveAYGFNBfW5n26U= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-189-8iH2sL03NYuPEvIw1z5f6Q-1; Tue, 15 Nov 2022 19:27:15 -0500 X-MC-Unique: 8iH2sL03NYuPEvIw1z5f6Q-1 Received: by mail-ej1-f72.google.com with SMTP id hs34-20020a1709073ea200b007ad86f91d39so8537529ejc.10 for ; Tue, 15 Nov 2022 16:27:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6B5zmJzGsBPfzhB/eaZE3rP0Ip1lxgaCkHFRucwCRbI=; b=3Aw6rxjdtCsOTYz5SzVu5rDatGIOtzO6vPm0NF059H3BJML/rE8ynYSuhnxIMf8Vcm Mg7ExkQb49izwBMyV6dDt3quJUmG02XM8f+AElxMvoSxSKNAD04kfrwJNVxJJBs/o1bs Jd4H84PioE/RnXJha/X9DCq2QKpCaoc2Z65Diaoc4rukJR+4BXKGej6DbQZbxIqrjHvX qysQaEkfThdpboRvDQ3FEnvXpzMOwIcg/gX72ATCsqXiMUmRQFEoYJ6G5jRn+j2cdZvA Vd7xwadLp3/KMEmetg2fBwAWGWSX8TzNVn6B/nKIUO91n5cDosoPqDrTXiP75zdCeK72 sDhw== X-Gm-Message-State: ANoB5plN85MQknmdz1jfeUe9XiKBD7n6UpfwzXhH+GnZDkQ3Ynzl45L7 0wXlCJJdCPRS5F2varmHkAgr7cOuTJL/sKW9uLG+r6K5UfL/xJVSc60YXwsTPhh3L0a8FsxTkIj PNeqlTSoY8we3RxowPV014NA6e5UbTMbIEQ== X-Received: by 2002:aa7:cf08:0:b0:461:a09b:aaf2 with SMTP id a8-20020aa7cf08000000b00461a09baaf2mr16805457edy.328.1668558433856; Tue, 15 Nov 2022 16:27:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ygNZR4bl8naMi4yJa43MHQLF7MxszzucbFVl1d587V9VCGR1XZENGi08FUcjWqpfnXOoeV9V8DwaOe5053x4= X-Received: by 2002:aa7:cf08:0:b0:461:a09b:aaf2 with SMTP id a8-20020aa7cf08000000b00461a09baaf2mr16805450edy.328.1668558433658; Tue, 15 Nov 2022 16:27:13 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Wed, 16 Nov 2022 00:27:02 +0000 Message-ID: Subject: Re: [PATCH] c++, v2: Implement C++23 P2647R1 - Permitting static constexpr variables in constexpr functions To: Jakub Jelinek Cc: Jason Merrill , gcc-patches@gcc.gnu.org, Marek Polacek 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_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 List-Id: On Tue, 15 Nov 2022 at 23:50, Jakub Jelinek wrote: > > On Tue, Nov 15, 2022 at 06:36:38PM -0500, Jason Merrill wrote: > > > Here is an updated patch that passed bootstrap/regtest, the only > > > change is another testcase tweak. > > > > > > 2022-11-13 Jakub Jelinek > > > > > > gcc/c-family/ > > > * c-cppbuiltin.cc (c_cpp_builtins): Bump __cpp_constexpr > > > value from 202207L to 202211L. > > > gcc/cp/ > > > * constexpr.cc (cxx_eval_constant_expression): Implement C++23 > > > P2647R1 - Permitting static constexpr variables in constexpr functions. > > > Allow decl_maybe_constant_var_p static or thread_local vars for > > > C++23. > > > > This was accepted as a DR, so it shouldn't be limited to C++23 mode. > > Certainly it should be allowed in C++20 mode; I don't have a strong opinion > > about C++14/17. Jonathan, do you? > > How will a feature with feature test macro with multiple values work as DR? > Or will everything but the macro be treated as a DR (so __cpp_constexpr >= > 202211L only for C++23)? Yes, I think so. We just won't be able to advertise this feature as supported in C++20. > Because __cpp_constexpr >= 202211L is >= 202207L too and that implies > P2448R2 which wasn't a DR and >= 202110L which implies P2242R3 which wasn't a > DR. And C++20 added other 2 non-DR papers that bumped the value. > C++17 another one. > > > > (potential_constant_expression_1): Likewise. > > > gcc/testsuite/ > > > * g++.dg/cpp23/constexpr-nonlit17.C: New test. > > > * g++.dg/cpp23/feat-cxx2b.C: Adjust expected __cpp_constexpr > > > value. > > > * g++.dg/ext/stmtexpr19.C: Don't expect an error for C++23 or later. > > Jakub >