From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 7B65D3858433; Wed, 22 Mar 2023 17:49:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B65D3858433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679507382; bh=M/2QRzHZjrMRD9/ORqrNmUj+hH8A9+AlX4QI3sBT6e0=; h=From:To:Subject:Date:From; b=sfaPbpvf3YaZNzgFbT7hARWBt1LkeID3bwFLwnx7rewoK4iv4+0ouXGdhlCbUxAsh 87ju+Jmlr/PAeBZM7sB6sX0a05fMZXE4RAwL/Sd224wmPEdWlFxs8JD3bzj9qK8Wc8 RrKPvsH0vMxzTKH8gFzIqjP2thyA6pdqW3/nWoq4= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-6809] libstdc++: Add missing __cpp_lib_format macro to X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: ba4f5530c475eadd2a7edb46b6c1c9d5f9267501 X-Git-Newrev: 02e86035d30e9f7b8645ebb64f4028900fc37126 Message-Id: <20230322174942.7B65D3858433@sourceware.org> Date: Wed, 22 Mar 2023 17:49:42 +0000 (GMT) List-Id: https://gcc.gnu.org/g:02e86035d30e9f7b8645ebb64f4028900fc37126 commit r13-6809-g02e86035d30e9f7b8645ebb64f4028900fc37126 Author: Jonathan Wakely Date: Wed Mar 22 12:37:17 2023 +0000 libstdc++: Add missing __cpp_lib_format macro to libstdc++-v3/ChangeLog: * include/std/version (__cpp_lib_format): Define. * testsuite/std/format/functions/format.cc: Check it. Diff: --- libstdc++-v3/include/std/version | 1 + libstdc++-v3/testsuite/std/format/functions/format.cc | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index 25ebfc3e512..a19c39c6cdd 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -277,6 +277,7 @@ #define __cpp_lib_constexpr_utility 201811L #define __cpp_lib_constexpr_vector 201907L #define __cpp_lib_erase_if 202002L +#define __cpp_lib_format 202106L #define __cpp_lib_generic_unordered_lookup 201811L #define __cpp_lib_interpolate 201902L #ifdef _GLIBCXX_HAS_GTHREADS diff --git a/libstdc++-v3/testsuite/std/format/functions/format.cc b/libstdc++-v3/testsuite/std/format/functions/format.cc index 7a155208a48..2a1b1560394 100644 --- a/libstdc++-v3/testsuite/std/format/functions/format.cc +++ b/libstdc++-v3/testsuite/std/format/functions/format.cc @@ -2,6 +2,21 @@ // { dg-do run { target c++20 } } #include + +#ifndef __cpp_lib_format +# error "Feature test macro for std::format is missing in " +#elif __cpp_lib_format < 202106L +# error "Feature test macro for std::format has wrong value in " +#endif + +#undef __cpp_lib_format +#include +#ifndef __cpp_lib_format +# error "Feature test macro for std::format is missing in " +#elif __cpp_lib_format < 202106L +# error "Feature test macro for std::format has wrong value in " +#endif + #include #include #include