]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add missing __cpp_lib_format macro to <version>
authorJonathan Wakely <jwakely@redhat.com>
Wed, 22 Mar 2023 12:37:17 +0000 (12:37 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 22 Mar 2023 17:48:20 +0000 (17:48 +0000)
libstdc++-v3/ChangeLog:

* include/std/version (__cpp_lib_format): Define.
* testsuite/std/format/functions/format.cc: Check it.

libstdc++-v3/include/std/version
libstdc++-v3/testsuite/std/format/functions/format.cc

index 25ebfc3e51227d204aaa58f12fb81ecb5879985b..a19c39c6cdd23ad9890297d62882f0bd343fd545 100644 (file)
 #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
index 7a155208a4858d809857ec16f9c37d33e4a0efa0..2a1b15603945aae605b1c8069d56900050938078 100644 (file)
@@ -2,6 +2,21 @@
 // { dg-do run { target c++20 } }
 
 #include <format>
+
+#ifndef __cpp_lib_format
+# error "Feature test macro for std::format is missing in <format>"
+#elif __cpp_lib_format < 202106L
+# error "Feature test macro for std::format has wrong value in <format>"
+#endif
+
+#undef __cpp_lib_format
+#include <version>
+#ifndef __cpp_lib_format
+# error "Feature test macro for std::format is missing in <version>"
+#elif __cpp_lib_format < 202106L
+# error "Feature test macro for std::format has wrong value in <version>"
+#endif
+
 #include <string>
 #include <limits>
 #include <cstdint>