aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-06-20 13:28:08 +0100
committerJonathan Wakely <jwakely@redhat.com>2024-06-21 10:10:10 +0100
commitf906b107634bfac29676e7fcf364d0ca7ceed666 (patch)
tree6a5385d344652a0581a0afea50a0fa9abb46727d /libstdc++-v3/testsuite
parent510ce5eed69ee1bea9c2c696fe3b2301e16d1486 (diff)
downloadgcc-f906b107634bfac29676e7fcf364d0ca7ceed666.zip
gcc-f906b107634bfac29676e7fcf364d0ca7ceed666.tar.gz
gcc-f906b107634bfac29676e7fcf364d0ca7ceed666.tar.bz2
libstdc++: Fix __cpp_lib_chrono for old std::string ABI
The <chrono> header is incomplete for the old std::string ABI, because std::chrono::tzdb is only defined for the new ABI. The feature test macro advertising full C++20 support should not be defined for the old ABI. libstdc++-v3/ChangeLog: * include/bits/version.def (chrono): Add cxx11abi = yes. * include/bits/version.h: Regenerate. * testsuite/std/time/syn_c++20.cc: Adjust expected value for the feature test macro.
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r--libstdc++-v3/testsuite/std/time/syn_c++20.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/libstdc++-v3/testsuite/std/time/syn_c++20.cc b/libstdc++-v3/testsuite/std/time/syn_c++20.cc
index f0b8619..4a52726 100644
--- a/libstdc++-v3/testsuite/std/time/syn_c++20.cc
+++ b/libstdc++-v3/testsuite/std/time/syn_c++20.cc
@@ -20,9 +20,16 @@
#include <chrono>
+// std::chrono::tzdb is not defined for the old std::string ABI.
+#if _GLIBCXX_USE_CXX_ABI
+# define EXPECTED_VALUE 201907L
+#else
+# define EXPECTED_VALUE 201611L
+#endif
+
#ifndef __cpp_lib_chrono
# error "Feature test macro for chrono is missing in <chrono>"
-#elif __cpp_lib_chrono < 201907L
+#elif __cpp_lib_chrono < EXPECTED_VALUE
# error "Feature test macro for chrono has wrong value in <chrono>"
#endif
@@ -94,7 +101,7 @@ namespace __gnu_test
using std::chrono::make12;
using std::chrono::make24;
-#if _GLIBCXX_USE_CXX11_ABI
+#if __cpp_lib_chrono >= 201803L
using std::chrono::tzdb;
using std::chrono::tzdb_list;
using std::chrono::get_tzdb;