public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6809] libstdc++: Add missing __cpp_lib_format macro to <version>
@ 2023-03-22 17:49 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-03-22 17:49 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:02e86035d30e9f7b8645ebb64f4028900fc37126

commit r13-6809-g02e86035d30e9f7b8645ebb64f4028900fc37126
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Mar 22 12:37:17 2023 +0000

    libstdc++: Add missing __cpp_lib_format macro to <version>
    
    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 <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>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-22 17:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-22 17:49 [gcc r13-6809] libstdc++: Add missing __cpp_lib_format macro to <version> Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).