diff --git a/libstdc++-v3/include/bits/version.def b/libstdc++-v3/include/bits/version.def index 683b967d54b13..42cdef2f5265c 100644 --- a/libstdc++-v3/include/bits/version.def +++ b/libstdc++-v3/include/bits/version.def @@ -574,6 +574,7 @@ ftms = { v = 201907; cxxmin = 20; hosted = yes; + cxx11abi = yes; // std::chrono::tzdb requires cxx11 std::string }; values = { v = 201611; diff --git a/libstdc++-v3/include/bits/version.h b/libstdc++-v3/include/bits/version.h index 4850041c0a3e7..1eaf3733bc2a8 100644 --- a/libstdc++-v3/include/bits/version.h +++ b/libstdc++-v3/include/bits/version.h @@ -639,7 +639,7 @@ #undef __glibcxx_want_boyer_moore_searcher #if !defined(__cpp_lib_chrono) -# if (__cplusplus >= 202002L) && _GLIBCXX_HOSTED +# if (__cplusplus >= 202002L) && _GLIBCXX_USE_CXX11_ABI && _GLIBCXX_HOSTED # define __glibcxx_chrono 201907L # if defined(__glibcxx_want_all) || defined(__glibcxx_want_chrono) # define __cpp_lib_chrono 201907L diff --git a/libstdc++-v3/testsuite/std/time/syn_c++20.cc b/libstdc++-v3/testsuite/std/time/syn_c++20.cc index f0b86199e9dbf..4a527262e9d82 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 +// 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 " -#elif __cpp_lib_chrono < 201907L +#elif __cpp_lib_chrono < EXPECTED_VALUE # error "Feature test macro for chrono has wrong value in " #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;