From: Jonathan Wakely Date: Wed, 22 Mar 2023 12:37:17 +0000 (+0000) Subject: libstdc++: Add missing __cpp_lib_format macro to X-Git-Tag: basepoints/gcc-14~398 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=02e86035d30e9f7b8645ebb64f4028900fc37126;p=thirdparty%2Fgcc.git 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 --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index 25ebfc3e5122..a19c39c6cdd2 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 7a155208a485..2a1b15603945 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