From patchwork Tue Jul 16 11:56:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1961063 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=FYM3yfss; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WNd9q4kG0z1xrQ for ; Tue, 16 Jul 2024 22:07:43 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8065E384A05E for ; Tue, 16 Jul 2024 12:07:41 +0000 (GMT) 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.129.124]) by sourceware.org (Postfix) with ESMTPS id 68FB8384A05E for ; Tue, 16 Jul 2024 12:04:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 68FB8384A05E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 68FB8384A05E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721131501; cv=none; b=j1XYX8sXriZPyyC+BCCkXxYZU9SoZTi0PBrl0dhobLlp/WqcFn8iUnXBRBDr0m90/2P0mRUqacAIZk8pv1t6oHrNSfjaUnR23LfuwrFRgICP3TE5Iz80wlRp5AVUdqeR3+7b3EHTCy5PyeoCzLxoIB0M8R+OVIj/RrNJtr1DWbs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721131501; c=relaxed/simple; bh=HTTca8TPpIdVSd5MReqLmTcceGCIrxRGx0EmVClq0JI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=A7nU7y0DRevT6PlFsZU8VARK3AAm3qz9x2Zg6NyKfIWHe5W15gWD8ubtK1xfyg0z94SRHVjnZsKjRWcSbKVMJ3bP4Y9yWbM9fheu73uNmxaR0aY0ZDSP8LeaFJ05o8svBfStp++nFVRTNQiGRtWdsVyleSGvhiyZEWSq9k890V4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721131494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mzsiIvda8K8aSK7MUbLz+pG4F4VulAsX0WNmJpnEiXU=; b=FYM3yfssQKLRwCX1TTsrV3SJJRpTCuI1hrLVYWBn4baVUq0rghpFT/OBtepGTXwleQv/CL PYRHWnzEVLiF9NnIo3tLGMJi3ALiZ7UymYOeUtEIGH+MmiWmBAkb5mXNxn9XpBFn//P4j1 ly/wv87puTrg0852+29SghkXp94zIBs= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-443-RBpbWYLhM8en0yXO4C23gg-1; Tue, 16 Jul 2024 08:04:51 -0400 X-MC-Unique: RBpbWYLhM8en0yXO4C23gg-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9B92D1955D4A; Tue, 16 Jul 2024 12:04:50 +0000 (UTC) Received: from localhost (unknown [10.42.28.14]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 07EB819560B2; Tue, 16 Jul 2024 12:04:49 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH 6/6] libstdc++: Bump __cpp_lib_format value for std::runtime_format Date: Tue, 16 Jul 2024 12:56:02 +0100 Message-ID: <20240716120436.2135312-6-jwakely@redhat.com> In-Reply-To: <20240716120436.2135312-1-jwakely@redhat.com> References: <20240716120436.2135312-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.5 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_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-linux. -- >8 -- We already supported this feature, but couldn't set the feature test macro accordingly because we were missing support for older features. Now that we support all the older changes, we can set this to the correct value. libstdc++-v3/ChangeLog: * include/bits/version.def (format): Update value for C++26. * include/bits/version.h: Regenerate. * include/std/format (runtime_format, wruntime_format): Check __cpp_lib_format instead of __cplusplus. * testsuite/std/format/functions/format.cc: Update expected value of macro for C++26 mode. --- libstdc++-v3/include/bits/version.def | 2 +- libstdc++-v3/include/bits/version.h | 4 ++-- libstdc++-v3/include/std/format | 2 +- libstdc++-v3/testsuite/std/format/functions/format.cc | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libstdc++-v3/include/bits/version.def b/libstdc++-v3/include/bits/version.def index ec330911d66..ee0a9e45c44 100644 --- a/libstdc++-v3/include/bits/version.def +++ b/libstdc++-v3/include/bits/version.def @@ -1171,7 +1171,7 @@ ftms = { // 202306 P2637R3 Member visit // 202311 P2918R2 Runtime format strings II values = { - v = 202306; + v = 202311; cxxmin = 26; hosted = yes; }; diff --git a/libstdc++-v3/include/bits/version.h b/libstdc++-v3/include/bits/version.h index 148ee87e087..cee497d7443 100644 --- a/libstdc++-v3/include/bits/version.h +++ b/libstdc++-v3/include/bits/version.h @@ -1310,9 +1310,9 @@ #if !defined(__cpp_lib_format) # if (__cplusplus > 202302L) && _GLIBCXX_HOSTED -# define __glibcxx_format 202306L +# define __glibcxx_format 202311L # if defined(__glibcxx_want_all) || defined(__glibcxx_want_format) -# define __cpp_lib_format 202306L +# define __cpp_lib_format 202311L # endif # elif (__cplusplus >= 202002L) && _GLIBCXX_HOSTED # define __glibcxx_format 202304L diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index f1a1f736a80..838cc18a78a 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -155,7 +155,7 @@ namespace __format = basic_format_string...>; #endif -#if __cplusplus > 202302L +#if __cpp_lib_format >= 202311L // >= C++26 [[__gnu__::__always_inline__]] inline __format::_Runtime_format_string runtime_format(string_view __fmt) noexcept diff --git a/libstdc++-v3/testsuite/std/format/functions/format.cc b/libstdc++-v3/testsuite/std/format/functions/format.cc index 0549d171e5a..7fc42017045 100644 --- a/libstdc++-v3/testsuite/std/format/functions/format.cc +++ b/libstdc++-v3/testsuite/std/format/functions/format.cc @@ -8,7 +8,7 @@ # error "Feature test macro for std::format is missing in " #elif __cpp_lib_format < 202110L # error "Feature test macro for std::format has wrong value in " -#elif __cplusplus > 202302L && __cpp_lib_format < 202306L +#elif __cplusplus > 202302L && __cpp_lib_format < 202311L # error "Feature test macro for std::format has wrong value in " #endif @@ -24,7 +24,7 @@ # error "Feature test macro for std::format is missing in " #elif __cpp_lib_format < 202110L # error "Feature test macro for std::format has wrong value in " -#elif __cplusplus > 202302L && __cpp_lib_format < 202306L +#elif __cplusplus > 202302L && __cpp_lib_format < 202311L # error "Feature test macro for std::format has wrong value in " #endif