]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Bump __cpp_lib_format value for std::runtime_format
authorJonathan Wakely <jwakely@redhat.com>
Tue, 16 Jul 2024 09:22:40 +0000 (10:22 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 31 Jul 2024 16:07:11 +0000 (17:07 +0100)
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 <format> 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
libstdc++-v3/include/bits/version.h
libstdc++-v3/include/std/format
libstdc++-v3/testsuite/std/format/functions/format.cc

index ec330911d665bbf34b838dabc5186e48f42e3fa3..ee0a9e45c441d272ed925bdaa3fc3da35db071ab 100644 (file)
@@ -1171,7 +1171,7 @@ ftms = {
   // 202306 P2637R3 Member visit
   // 202311 P2918R2 Runtime format strings II
   values = {
-    v = 202306;
+    v = 202311;
     cxxmin = 26;
     hosted = yes;
   };
index 148ee87e087c624a2be423a3a6ba6e78d5d3ccc4..cee497d7443fa2eafde5975696e996d81c0d0533 100644 (file)
 
 #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
index 715fdf93492457fdb6dbd8c142cf0ce175e31184..3280dadfb90e149eeb78e73a8d1133c8a976442c 100644 (file)
@@ -155,7 +155,7 @@ namespace __format
       = basic_format_string<wchar_t, type_identity_t<_Args>...>;
 #endif
 
-#if __cplusplus > 202302L
+#if __cpp_lib_format >= 202311L // >= C++26
   [[__gnu__::__always_inline__]]
   inline __format::_Runtime_format_string<char>
   runtime_format(string_view __fmt) noexcept
index 0549d171e5a24e3b7ef70b8ce2993d265b6c0416..7fc420170458de178ef987f416da5687981ad1f2 100644 (file)
@@ -8,7 +8,7 @@
 # error "Feature test macro for std::format is missing in <format>"
 #elif __cpp_lib_format < 202110L
 # error "Feature test macro for std::format has wrong value in <format>"
-#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 <format>"
 #endif
 
@@ -24,7 +24,7 @@
 # error "Feature test macro for std::format is missing in <version>"
 #elif __cpp_lib_format < 202110L
 # error "Feature test macro for std::format has wrong value in <version>"
-#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 <version>"
 #endif