From: Hugo Beauzée-Luyssen <[email protected]>

The C++20 chrono time zone API is declared when
_GLIBCXX_USE_CXX11_ABI || !_GLIBCXX_USE_DUAL_ABI, but
__cpp_lib_chrono only gets its C++20 and C++26 values when
_GLIBCXX_USE_CXX11_ABI is set.  Old-ABI-only builds therefore get
the full API but report the C++17 value.

Use the same condition for the 201907 and 202306 values, and make the
headers check __glibcxx_chrono instead of repeating the ABI condition.

Add a chrono_tz effective target for that condition, and use it in
the tests that were limited to the new ABI, so they also run on
old-ABI-only builds.

libstdc++-v3/ChangeLog:

        * include/bits/version.def (chrono): Also define 201907 and
        202306 for old-ABI-only builds.
        * include/bits/version.h: Regenerate.
        * include/std/chrono: Check __glibcxx_chrono instead of the
        ABI macros.
        * include/bits/chrono_io.h: Likewise.
        * testsuite/lib/libstdc++.exp (check_effective_target_chrono_tz):
        New proc.
        (check_effective_target_tzdb): Use it.
        * testsuite/std/time/syn_c++20.cc: Fix the ABI check for the
        expected value.
        * testsuite/std/time/hash.cc: Also test old-ABI-only builds.
        * testsuite/std/time/format/pr117214.cc: Likewise.
        * testsuite/libstdc++-prettyprinters/chrono.cc: Likewise.
        * testsuite/std/time/format/data_not_present_neg.cc: Likewise,
        and use chrono_tz instead of cxx11_abi.
        * testsuite/std/time/clock/utc/leap_second_info-2.cc: Require
        chrono_tz instead of cxx11_abi.
        * testsuite/std/time/leap_seconds/io.cc: Likewise.
        * testsuite/std/time/time_zone/116110.cc: Likewise.
        * testsuite/std/time/time_zone/124513.cc: Likewise.
        * testsuite/std/time/time_zone/numeric_save.cc: Likewise.
        * testsuite/std/time/time_zone/pr116110_named.cc: Likewise.
        * testsuite/std/time/time_zone/requirements.cc: Likewise.
        * testsuite/std/time/time_zone/sys_info_abbrev.cc: Likewise.
        * testsuite/std/time/time_zone/until_day_on.cc: Likewise.
        * testsuite/std/time/time_zone/wall_cascade.cc: Likewise.
        * testsuite/std/time/time_zone/zone_merge.cc: Likewise.
        * testsuite/std/time/tzdb/1.cc: Likewise.
        * testsuite/std/time/tzdb/leap_seconds.cc: Likewise.
        * testsuite/std/time/tzdb/links.cc: Likewise.
        * testsuite/std/time/tzdb_list/1.cc: Likewise.
        * testsuite/std/time/tzdb_list/pr118811.cc: Likewise.
        * testsuite/std/time/tzdb_list/requirements.cc: Likewise.
        * testsuite/std/time/tzdb/name_matching.cc: Likewise.
        * testsuite/std/time/zoned_time/1.cc: Likewise.
        * testsuite/std/time/zoned_time/deduction.cc: Likewise.
        * testsuite/std/time/zoned_time/io.cc: Likewise.
        * testsuite/std/time/zoned_time/req_neg.cc: Likewise.
        * testsuite/std/time/zoned_time/requirements.cc: Likewise.
        * testsuite/std/time/zoned_traits.cc: Likewise.

Assisted-by: Claude (claude-sonnet-5)
Signed-off-by: Hugo Beauzée-Luyssen <[email protected]>
---
Changes since v3:
- Use __glibcxx_chrono in <chrono> and <bits/chrono_io.h>.
- Use the same condition for the 202306 value, without parentheses.
- Add a chrono_tz effective target and use it in the tests that
  require the time zone API, so they also run on old-ABI-only builds.
- Fix the _GLIBCXX_USE_CXX_ABI typo in std/time/syn_c++20.cc.

 libstdc++-v3/include/bits/chrono_io.h         |  8 ++--
 libstdc++-v3/include/bits/version.def         |  4 +-
 libstdc++-v3/include/bits/version.h           |  4 +-
 libstdc++-v3/include/std/chrono               | 12 +++---
 libstdc++-v3/testsuite/lib/libstdc++.exp      |  8 +++-
 .../libstdc++-prettyprinters/chrono.cc        |  4 +-
 .../std/time/clock/utc/leap_second_info-2.cc  |  2 +-
 .../std/time/format/data_not_present_neg.cc   | 38 +++++++++----------
 .../testsuite/std/time/format/pr117214.cc     |  4 +-
 libstdc++-v3/testsuite/std/time/hash.cc       |  8 ++--
 .../testsuite/std/time/leap_seconds/io.cc     |  2 +-
 libstdc++-v3/testsuite/std/time/syn_c++20.cc  |  5 ++-
 .../testsuite/std/time/time_zone/116110.cc    |  2 +-
 .../testsuite/std/time/time_zone/124513.cc    |  2 +-
 .../std/time/time_zone/numeric_save.cc        |  2 +-
 .../std/time/time_zone/pr116110_named.cc      |  2 +-
 .../std/time/time_zone/requirements.cc        |  2 +-
 .../std/time/time_zone/sys_info_abbrev.cc     |  2 +-
 .../std/time/time_zone/until_day_on.cc        |  2 +-
 .../std/time/time_zone/wall_cascade.cc        |  2 +-
 .../std/time/time_zone/zone_merge.cc          |  2 +-
 libstdc++-v3/testsuite/std/time/tzdb/1.cc     |  2 +-
 .../testsuite/std/time/tzdb/leap_seconds.cc   |  2 +-
 libstdc++-v3/testsuite/std/time/tzdb/links.cc |  2 +-
 .../testsuite/std/time/tzdb/name_matching.cc  |  2 +-
 .../testsuite/std/time/tzdb_list/1.cc         |  2 +-
 .../testsuite/std/time/tzdb_list/pr118811.cc  |  2 +-
 .../std/time/tzdb_list/requirements.cc        |  2 +-
 .../testsuite/std/time/zoned_time/1.cc        |  2 +-
 .../std/time/zoned_time/deduction.cc          |  2 +-
 .../testsuite/std/time/zoned_time/io.cc       |  2 +-
 .../testsuite/std/time/zoned_time/req_neg.cc  |  2 +-
 .../std/time/zoned_time/requirements.cc       |  2 +-
 .../testsuite/std/time/zoned_traits.cc        |  2 +-
 34 files changed, 75 insertions(+), 68 deletions(-)

diff --git a/libstdc++-v3/include/bits/chrono_io.h 
b/libstdc++-v3/include/bits/chrono_io.h
index 028e6007544..a6be222689d 100644
--- a/libstdc++-v3/include/bits/chrono_io.h
+++ b/libstdc++-v3/include/bits/chrono_io.h
@@ -2083,7 +2083,7 @@ namespace __format
        }
     };
 
-#if _GLIBCXX_USE_CXX11_ABI || ! _GLIBCXX_USE_DUAL_ABI
+#if __glibcxx_chrono >= 201803L
   template<typename _CharT>
     struct __formatter_chrono_info
     {
@@ -3004,7 +3004,7 @@ namespace __format
       = enable_nonlocking_formatter_optimization<_Duration>;
 #endif
 
-#if _GLIBCXX_USE_CXX11_ABI || ! _GLIBCXX_USE_DUAL_ABI
+#if __glibcxx_chrono >= 201803L
   template<__format::__char _CharT>
     struct formatter<chrono::sys_info, _CharT>
     {
@@ -3395,7 +3395,7 @@ namespace __format
       = enable_nonlocking_formatter_optimization<_Duration>;
 #endif
 
-#if _GLIBCXX_USE_CXX11_ABI || ! _GLIBCXX_USE_DUAL_ABI
+#if __glibcxx_chrono >= 201803L
   template<typename _Duration, typename _TimeZonePtr, __format::__char _CharT>
     struct formatter<chrono::zoned_time<_Duration, _TimeZonePtr>, _CharT>
     : formatter<chrono::__detail::__local_time_fmt_for<_Duration>, _CharT>
@@ -3872,7 +3872,7 @@ namespace __detail
        return __detail::__chrono_write<64>(__os, __hms, __os.getloc());
     }
 
-#if _GLIBCXX_USE_CXX11_ABI || ! _GLIBCXX_USE_DUAL_ABI
+#if __glibcxx_chrono >= 201803L
   /// Writes a sys_info object to an ostream in an unspecified format.
   template<typename _CharT, typename _Traits>
     basic_ostream<_CharT, _Traits>&
diff --git a/libstdc++-v3/include/bits/version.def 
b/libstdc++-v3/include/bits/version.def
index 9c523581c65..35ffb87a3ff 100644
--- a/libstdc++-v3/include/bits/version.def
+++ b/libstdc++-v3/include/bits/version.def
@@ -616,13 +616,13 @@ ftms = {
     v = 202306;
     cxxmin = 26;
     hosted = yes;
-    cxx11abi = yes;
+    extra_cond = "_GLIBCXX_USE_CXX11_ABI || !_GLIBCXX_USE_DUAL_ABI";
   };
   values = {
     v = 201907;
     cxxmin = 20;
     hosted = yes;
-    cxx11abi = yes; // std::chrono::tzdb requires cxx11 std::string
+    extra_cond = "_GLIBCXX_USE_CXX11_ABI || !_GLIBCXX_USE_DUAL_ABI";
   };
   values = {
     v = 201611;
diff --git a/libstdc++-v3/include/bits/version.h 
b/libstdc++-v3/include/bits/version.h
index e0003054af6..25327bdeb57 100644
--- a/libstdc++-v3/include/bits/version.h
+++ b/libstdc++-v3/include/bits/version.h
@@ -681,12 +681,12 @@
 #undef __glibcxx_want_boyer_moore_searcher
 
 #if !defined(__cpp_lib_chrono)
-# if (__cplusplus >  202302L) && _GLIBCXX_USE_CXX11_ABI && _GLIBCXX_HOSTED
+# if (__cplusplus >  202302L) && _GLIBCXX_HOSTED && (_GLIBCXX_USE_CXX11_ABI || 
!_GLIBCXX_USE_DUAL_ABI)
 #  define __glibcxx_chrono 202306L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_chrono)
 #   define __cpp_lib_chrono 202306L
 #  endif
-# elif (__cplusplus >= 202002L) && _GLIBCXX_USE_CXX11_ABI && _GLIBCXX_HOSTED
+# elif (__cplusplus >= 202002L) && _GLIBCXX_HOSTED && (_GLIBCXX_USE_CXX11_ABI 
|| !_GLIBCXX_USE_DUAL_ABI)
 #  define __glibcxx_chrono 201907L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_chrono)
 #   define __cpp_lib_chrono 201907L
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index faa849b75b3..29bc155f743 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -57,7 +57,7 @@
 # include <bits/stl_algo.h>     // upper_bound
 # include <bits/range_access.h> // begin/end for arrays
 #endif
-#if __cpp_lib_chrono >= 201803L // C++20 && HOSTED && USE_CXX11_ABI
+#if __glibcxx_chrono >= 201803L // C++20 && HOSTED
 # include <sstream>
 # include <string>
 # include <vector>
@@ -2529,7 +2529,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
 #if _GLIBCXX_HOSTED
-#if _GLIBCXX_USE_CXX11_ABI || ! _GLIBCXX_USE_DUAL_ABI
+#if __glibcxx_chrono >= 201803L
     // C++20 [time.zones] Time zones
 
     struct tzdb;
@@ -3204,7 +3204,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
     using zoned_seconds = zoned_time<seconds>;
-#endif // _GLIBCXX_USE_CXX11_ABI || ! _GLIBCXX_USE_DUAL_ABI
+#endif // __glibcxx_chrono >= 201803L
 
 namespace __detail
 {
@@ -3259,7 +3259,7 @@ namespace __detail
 
       if (__ss > __expires)
        {
-#if _GLIBCXX_USE_CXX11_ABI || ! _GLIBCXX_USE_DUAL_ABI // use chrono::tzdb
+#if __glibcxx_chrono >= 201803L // use chrono::tzdb
          // Call into the library because it might have knowledge of new
          // leap seconds loaded at runtime from the tzdata files.
 
@@ -3586,7 +3586,7 @@ namespace __detail
     };
 
 #if _GLIBCXX_HOSTED
-#if _GLIBCXX_USE_CXX11_ABI || ! _GLIBCXX_USE_DUAL_ABI
+#if __glibcxx_chrono >= 201803L
   // zoned_time
   template<typename _Duration, typename _TimeZonePtr>
     requires __is_hash_enabled_for<
@@ -3643,7 +3643,7 @@ namespace __detail
                 __val.value().count());
       }
     };
-#endif // _GLIBCXX_USE_CXX11_ABI || ! _GLIBCXX_USE_DUAL_ABI
+#endif // __glibcxx_chrono >= 201803L
 #endif // _GLIBCXX_HOSTED
 #endif // __glibcxx_chrono_cxx20 >= 202306
 
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp 
b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 3e8240d73a5..fac59c746e7 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -1641,9 +1641,15 @@ proc check_effective_target_hosted { } {
     }]
 }
 
+# Return 1 if the C++20 time zone API (std::chrono::tzdb etc.) is declared.
+proc check_effective_target_chrono_tz { } {
+    set cond "_GLIBCXX_USE_CXX11_ABI || !_GLIBCXX_USE_DUAL_ABI"
+    return [v3_check_preprocessor_condition chrono_tz $cond]
+}
+
 # Return 1 if std::chrono::tzdb is supported.
 proc check_effective_target_tzdb { } {
-    if {![check_effective_target_cxx11_abi]} {
+    if {![check_effective_target_chrono_tz]} {
        return 0
     }
     return [check_v3_target_prop_cached et_tzdb {
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/chrono.cc 
b/libstdc++-v3/testsuite/libstdc++-prettyprinters/chrono.cc
index c10198df06e..0bbe82726ec 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/chrono.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/chrono.cc
@@ -39,9 +39,9 @@ main()
   utc_time utc(467664h);
   // { dg-final { note-test utc {std::chrono::utc_time = { 467664h }} } }
 
-#if _GLIBCXX_USE_CXX11_ABI && defined TEST_ZONED_TIME
+#if (_GLIBCXX_USE_CXX11_ABI || !_GLIBCXX_USE_DUAL_ABI) && defined 
TEST_ZONED_TIME
   zoned_time<milliseconds> zt("Europe/London", half_past_epoch);
-  // { dg-final { note-test zt {std::chrono::zoned_time = { "Europe/London" 
1800000ms [1970-01-01 00:30:00] }} { target cxx11_abi } } }
+  // { dg-final { note-test zt {std::chrono::zoned_time = { "Europe/London" 
1800000ms [1970-01-01 00:30:00] }} { target chrono_tz } } }
 #endif
 
   [[maybe_unused]] day ninth(9);
diff --git a/libstdc++-v3/testsuite/std/time/clock/utc/leap_second_info-2.cc 
b/libstdc++-v3/testsuite/std/time/clock/utc/leap_second_info-2.cc
index 4f97c2eacaa..5a24d4da4b2 100644
--- a/libstdc++-v3/testsuite/std/time/clock/utc/leap_second_info-2.cc
+++ b/libstdc++-v3/testsuite/std/time/clock/utc/leap_second_info-2.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 // { dg-xfail-run-if "no weak override on AIX" { powerpc-ibm-aix* } }
 
 #include <chrono>
diff --git a/libstdc++-v3/testsuite/std/time/format/data_not_present_neg.cc 
b/libstdc++-v3/testsuite/std/time/format/data_not_present_neg.cc
index 183dca8310f..b3650277d83 100644
--- a/libstdc++-v3/testsuite/std/time/format/data_not_present_neg.cc
+++ b/libstdc++-v3/testsuite/std/time/format/data_not_present_neg.cc
@@ -119,9 +119,9 @@ auto tai = std::format("{:%Q}", tai_clock::now()); // { 
dg-error "call to conste
 auto file = std::format("{:%Q}", file_clock::now()); // { dg-error "call to 
consteval function" }
 
 const auto ltc = local_seconds(10s);
-#if _GLIBCXX_USE_CXX11_ABI
+#if _GLIBCXX_USE_CXX11_ABI || !_GLIBCXX_USE_DUAL_ABI
 const auto zt = zoned_time<seconds>("Europe/Sofia", local_seconds(10s));
-auto zt1 = std::format("{:%Q}", zt); // { dg-error "call to consteval 
function" "" { target cxx11_abi } }
+auto zt1 = std::format("{:%Q}", zt); // { dg-error "call to consteval 
function" "" { target chrono_tz } }
 #endif
 auto lf1 = std::format("{:%Q}", local_time_format(ltc)); // { dg-error "call 
to consteval function" }
 
@@ -141,24 +141,24 @@ auto hms5 = std::format("{:%F}", HMS(1255s)); // { 
dg-error "call to consteval f
 auto hms6 = std::format("{:%Q}", HMS(1255s)); // { dg-error "call to consteval 
function" }
 auto hms7 = std::format("{:%Z}", HMS(1255s)); // { dg-error "call to consteval 
function" }
 
-#if _GLIBCXX_USE_CXX11_ABI
-auto li1 = std::format("{:%d}", local_info()); // { dg-error "call to 
consteval function" "" { target cxx11_abi } }
-auto li2 = std::format("{:%w}", local_info()); // { dg-error "call to 
consteval function" "" { target cxx11_abi } }
-auto li3 = std::format("{:%m}", local_info()); // { dg-error "call to 
consteval function" "" { target cxx11_abi } }
-auto li4 = std::format("{:%y}", local_info()); // { dg-error "call to 
consteval function" "" { target cxx11_abi } }
-auto li5 = std::format("{:%F}", local_info()); // { dg-error "call to 
consteval function" "" { target cxx11_abi } }
-auto li6 = std::format("{:%T}", local_info()); // { dg-error "call to 
consteval function" "" { target cxx11_abi } }
-auto li7 = std::format("{:%Q}", local_info()); // { dg-error "call to 
consteval function" "" { target cxx11_abi } }
-auto li8 = std::format("{:%Z}", local_info()); // { dg-error "call to 
consteval function" "" { target cxx11_abi } }
+#if _GLIBCXX_USE_CXX11_ABI || !_GLIBCXX_USE_DUAL_ABI
+auto li1 = std::format("{:%d}", local_info()); // { dg-error "call to 
consteval function" "" { target chrono_tz } }
+auto li2 = std::format("{:%w}", local_info()); // { dg-error "call to 
consteval function" "" { target chrono_tz } }
+auto li3 = std::format("{:%m}", local_info()); // { dg-error "call to 
consteval function" "" { target chrono_tz } }
+auto li4 = std::format("{:%y}", local_info()); // { dg-error "call to 
consteval function" "" { target chrono_tz } }
+auto li5 = std::format("{:%F}", local_info()); // { dg-error "call to 
consteval function" "" { target chrono_tz } }
+auto li6 = std::format("{:%T}", local_info()); // { dg-error "call to 
consteval function" "" { target chrono_tz } }
+auto li7 = std::format("{:%Q}", local_info()); // { dg-error "call to 
consteval function" "" { target chrono_tz } }
+auto li8 = std::format("{:%Z}", local_info()); // { dg-error "call to 
consteval function" "" { target chrono_tz } }
 
-auto si1 = std::format("{:%d}", sys_info()); // { dg-error "call to consteval 
function" "" { target cxx11_abi } }
-auto si2 = std::format("{:%w}", sys_info()); // { dg-error "call to consteval 
function" "" { target cxx11_abi } }
-auto si3 = std::format("{:%m}", sys_info()); // { dg-error "call to consteval 
function" "" { target cxx11_abi } }
-auto si4 = std::format("{:%y}", sys_info()); // { dg-error "call to consteval 
function" "" { target cxx11_abi } }
-auto si5 = std::format("{:%F}", sys_info()); // { dg-error "call to consteval 
function" "" { target cxx11_abi } }
-auto si6 = std::format("{:%T}", sys_info()); // { dg-error "call to consteval 
function" "" { target cxx11_abi } }
-auto si7 = std::format("{:%Q}", sys_info()); // { dg-error "call to consteval 
function" "" { target cxx11_abi } }
-auto si8 = std::format("{:%Z}", sys_info()); // { dg-error "call to consteval 
function" "" { target cxx11_abi } }
+auto si1 = std::format("{:%d}", sys_info()); // { dg-error "call to consteval 
function" "" { target chrono_tz } }
+auto si2 = std::format("{:%w}", sys_info()); // { dg-error "call to consteval 
function" "" { target chrono_tz } }
+auto si3 = std::format("{:%m}", sys_info()); // { dg-error "call to consteval 
function" "" { target chrono_tz } }
+auto si4 = std::format("{:%y}", sys_info()); // { dg-error "call to consteval 
function" "" { target chrono_tz } }
+auto si5 = std::format("{:%F}", sys_info()); // { dg-error "call to consteval 
function" "" { target chrono_tz } }
+auto si6 = std::format("{:%T}", sys_info()); // { dg-error "call to consteval 
function" "" { target chrono_tz } }
+auto si7 = std::format("{:%Q}", sys_info()); // { dg-error "call to consteval 
function" "" { target chrono_tz } }
+auto si8 = std::format("{:%Z}", sys_info()); // { dg-error "call to consteval 
function" "" { target chrono_tz } }
 #endif
 
 // { dg-error "call to non-'constexpr' function" "" { target { c++23_down || { 
! cxx11_abi } } } 0 }
diff --git a/libstdc++-v3/testsuite/std/time/format/pr117214.cc 
b/libstdc++-v3/testsuite/std/time/format/pr117214.cc
index 79109c39151..8fdcda1f774 100644
--- a/libstdc++-v3/testsuite/std/time/format/pr117214.cc
+++ b/libstdc++-v3/testsuite/std/time/format/pr117214.cc
@@ -82,7 +82,7 @@ void maybe_set_tz()
 void
 test_c_zoned()
 {
-#if _GLIBCXX_USE_CXX11_ABI
+#if _GLIBCXX_USE_CXX11_ABI || !_GLIBCXX_USE_DUAL_ABI
   maybe_set_tz();
 
   using namespace std::chrono;
@@ -118,7 +118,7 @@ test_c_local()
   VERIFY( s.find("GMT") == s.npos );
   VERIFY( s.find("UTC") == s.npos );
 
-#if _GLIBCXX_USE_CXX11_ABI
+#if _GLIBCXX_USE_CXX11_ABI || !_GLIBCXX_USE_DUAL_ABI
   zoned_time z(system_clock::now());
   VERIFY( s.find(z.get_info().abbrev) == s.npos );
 #endif
diff --git a/libstdc++-v3/testsuite/std/time/hash.cc 
b/libstdc++-v3/testsuite/std/time/hash.cc
index ed9139bb810..8c47c3bacce 100644
--- a/libstdc++-v3/testsuite/std/time/hash.cc
+++ b/libstdc++-v3/testsuite/std/time/hash.cc
@@ -5,7 +5,7 @@
 #include <limits.h>
 #include <testsuite_hooks.h>
 
-#if _GLIBCXX_USE_CXX11_ABI
+#if _GLIBCXX_USE_CXX11_ABI || !_GLIBCXX_USE_DUAL_ABI
 #  if !defined(__cpp_lib_chrono)
 #    error "__cpp_lib_chrono not defined"
 #  elif __cpp_lib_chrono < 202306L
@@ -188,7 +188,7 @@ void test01()
   test_hash(2024y / month(1234u) / Tuesday[last]);
   test_hash(2024y / August / weekday(1234u)[last]);
 
-#if _GLIBCXX_USE_CXX11_ABI
+#if _GLIBCXX_USE_CXX11_ABI || !_GLIBCXX_USE_DUAL_ABI
   // zoned_time
   test_hash(zoned_seconds("Europe/Rome", sys_seconds(1234s)));
   test_hash(zoned_time("Europe/Rome", system_clock::now()));
@@ -238,7 +238,7 @@ void test03()
   {
     test_hash(d);
     test_hash(sys_time<D>(d));
-#if _GLIBCXX_USE_CXX11_ABI
+#if _GLIBCXX_USE_CXX11_ABI || !_GLIBCXX_USE_DUAL_ABI
     test_hash(zoned_time<D>(sys_time<D>(d)));
 #endif
   };
@@ -261,7 +261,7 @@ void test04()
   
static_assert(is_hash_poisoned<duration<non_hashable_arithmetic_wrapper<int>>>);
   
static_assert(is_hash_poisoned<duration<non_hashable_arithmetic_wrapper<double>>>);
 
-#if _GLIBCXX_USE_CXX11_ABI
+#if _GLIBCXX_USE_CXX11_ABI || !_GLIBCXX_USE_DUAL_ABI
   static_assert(!is_hash_poisoned<zoned_time<duration<int>>>);
   static_assert(!is_hash_poisoned<zoned_time<duration<double>>>);
   
static_assert(!is_hash_poisoned<zoned_time<duration<arithmetic_wrapper<int>>>>);
diff --git a/libstdc++-v3/testsuite/std/time/leap_seconds/io.cc 
b/libstdc++-v3/testsuite/std/time/leap_seconds/io.cc
index 511fafdd1a0..66181eaa581 100644
--- a/libstdc++-v3/testsuite/std/time/leap_seconds/io.cc
+++ b/libstdc++-v3/testsuite/std/time/leap_seconds/io.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 
 #include <chrono>
 #include <sstream>
diff --git a/libstdc++-v3/testsuite/std/time/syn_c++20.cc 
b/libstdc++-v3/testsuite/std/time/syn_c++20.cc
index 01d5b265129..60ce0033174 100644
--- a/libstdc++-v3/testsuite/std/time/syn_c++20.cc
+++ b/libstdc++-v3/testsuite/std/time/syn_c++20.cc
@@ -20,8 +20,9 @@
 
 #include <chrono>
 
-// std::chrono::tzdb is not defined for the old std::string ABI.
-#if _GLIBCXX_USE_CXX_ABI
+// std::chrono::tzdb is not defined for the old std::string ABI,
+// unless the dual ABI is disabled.
+#if _GLIBCXX_USE_CXX11_ABI || !_GLIBCXX_USE_DUAL_ABI
 # define EXPECTED_VALUE 201907L
 #else
 # define EXPECTED_VALUE 201611L
diff --git a/libstdc++-v3/testsuite/std/time/time_zone/116110.cc 
b/libstdc++-v3/testsuite/std/time/time_zone/116110.cc
index 45daed8c050..e6f667f82aa 100644
--- a/libstdc++-v3/testsuite/std/time/time_zone/116110.cc
+++ b/libstdc++-v3/testsuite/std/time/time_zone/116110.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 
 #include <chrono>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/std/time/time_zone/124513.cc 
b/libstdc++-v3/testsuite/std/time/time_zone/124513.cc
index 49d7ba8bb01..4c67faebbe7 100644
--- a/libstdc++-v3/testsuite/std/time/time_zone/124513.cc
+++ b/libstdc++-v3/testsuite/std/time/time_zone/124513.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 // { dg-xfail-run-if "no weak override on AIX" { powerpc-ibm-aix* } }
 
 #include <chrono>
diff --git a/libstdc++-v3/testsuite/std/time/time_zone/numeric_save.cc 
b/libstdc++-v3/testsuite/std/time/time_zone/numeric_save.cc
index 687524bb355..08bb180b753 100644
--- a/libstdc++-v3/testsuite/std/time/time_zone/numeric_save.cc
+++ b/libstdc++-v3/testsuite/std/time/time_zone/numeric_save.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 // { dg-xfail-run-if "no weak override on AIX" { powerpc-ibm-aix* } }
 
 // When a Zone line specifies a numeric value as its RULES field, that
diff --git a/libstdc++-v3/testsuite/std/time/time_zone/pr116110_named.cc 
b/libstdc++-v3/testsuite/std/time/time_zone/pr116110_named.cc
index b3bf4eb1aa9..4a73a2de8a2 100644
--- a/libstdc++-v3/testsuite/std/time/time_zone/pr116110_named.cc
+++ b/libstdc++-v3/testsuite/std/time/time_zone/pr116110_named.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 // { dg-xfail-run-if "no weak override on AIX" { powerpc-ibm-aix* } }
 
 // Africa/Algiers 1977-10-21: a Zone line whose RULES references a
diff --git a/libstdc++-v3/testsuite/std/time/time_zone/requirements.cc 
b/libstdc++-v3/testsuite/std/time/time_zone/requirements.cc
index 929fea2c0eb..ba7fe985c90 100644
--- a/libstdc++-v3/testsuite/std/time/time_zone/requirements.cc
+++ b/libstdc++-v3/testsuite/std/time/time_zone/requirements.cc
@@ -1,5 +1,5 @@
 // { dg-do compile { target c++20 } }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 
 #include <chrono>
 
diff --git a/libstdc++-v3/testsuite/std/time/time_zone/sys_info_abbrev.cc 
b/libstdc++-v3/testsuite/std/time/time_zone/sys_info_abbrev.cc
index f1a8fff02f5..4a13584edf3 100644
--- a/libstdc++-v3/testsuite/std/time/time_zone/sys_info_abbrev.cc
+++ b/libstdc++-v3/testsuite/std/time/time_zone/sys_info_abbrev.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 // { dg-xfail-run-if "no weak override on AIX" { powerpc-ibm-aix* } }
 
 #include <chrono>
diff --git a/libstdc++-v3/testsuite/std/time/time_zone/until_day_on.cc 
b/libstdc++-v3/testsuite/std/time/time_zone/until_day_on.cc
index 38e4bc254cc..11d15d26382 100644
--- a/libstdc++-v3/testsuite/std/time/time_zone/until_day_on.cc
+++ b/libstdc++-v3/testsuite/std/time/time_zone/until_day_on.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 // { dg-xfail-run-if "no weak override on AIX" { powerpc-ibm-aix* } }
 
 // The DAY portion of a Zone line's UNTIL field accepts not only a
diff --git a/libstdc++-v3/testsuite/std/time/time_zone/wall_cascade.cc 
b/libstdc++-v3/testsuite/std/time/time_zone/wall_cascade.cc
index fcce1937ea6..0b297c223c3 100644
--- a/libstdc++-v3/testsuite/std/time/time_zone/wall_cascade.cc
+++ b/libstdc++-v3/testsuite/std/time/time_zone/wall_cascade.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 // { dg-xfail-run-if "no weak override on AIX" { powerpc-ibm-aix* } }
 
 // Wall-time rules in the same rule set whose effective firing time
diff --git a/libstdc++-v3/testsuite/std/time/time_zone/zone_merge.cc 
b/libstdc++-v3/testsuite/std/time/time_zone/zone_merge.cc
index 75942f976b6..8c3836cfd0f 100644
--- a/libstdc++-v3/testsuite/std/time/time_zone/zone_merge.cc
+++ b/libstdc++-v3/testsuite/std/time/time_zone/zone_merge.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 // { dg-xfail-run-if "no weak override on AIX" { powerpc-ibm-aix* } }
 
 // When two adjacent Zone lines differ in total offset and the new line's
diff --git a/libstdc++-v3/testsuite/std/time/tzdb/1.cc 
b/libstdc++-v3/testsuite/std/time/tzdb/1.cc
index 7a31c1c20ba..97d61006752 100644
--- a/libstdc++-v3/testsuite/std/time/tzdb/1.cc
+++ b/libstdc++-v3/testsuite/std/time/tzdb/1.cc
@@ -1,5 +1,5 @@
 // { dg-do run { target c++20 } }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 
 #include <chrono>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/std/time/tzdb/leap_seconds.cc 
b/libstdc++-v3/testsuite/std/time/tzdb/leap_seconds.cc
index 5999635a89f..10a2f4cbcea 100644
--- a/libstdc++-v3/testsuite/std/time/tzdb/leap_seconds.cc
+++ b/libstdc++-v3/testsuite/std/time/tzdb/leap_seconds.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 // { dg-xfail-run-if "no weak override on AIX" { powerpc-ibm-aix* } }
 
 #include <chrono>
diff --git a/libstdc++-v3/testsuite/std/time/tzdb/links.cc 
b/libstdc++-v3/testsuite/std/time/tzdb/links.cc
index 0ba214846c6..3579b03c4a9 100644
--- a/libstdc++-v3/testsuite/std/time/tzdb/links.cc
+++ b/libstdc++-v3/testsuite/std/time/tzdb/links.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 // { dg-xfail-run-if "no weak override on AIX" { powerpc-ibm-aix* } }
 
 #include <chrono>
diff --git a/libstdc++-v3/testsuite/std/time/tzdb/name_matching.cc 
b/libstdc++-v3/testsuite/std/time/tzdb/name_matching.cc
index 8d845ab94b9..c0257b0eb98 100644
--- a/libstdc++-v3/testsuite/std/time/tzdb/name_matching.cc
+++ b/libstdc++-v3/testsuite/std/time/tzdb/name_matching.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 // { dg-xfail-run-if "no weak override on AIX" { powerpc-ibm-aix* } }
 
 #include <chrono>
diff --git a/libstdc++-v3/testsuite/std/time/tzdb_list/1.cc 
b/libstdc++-v3/testsuite/std/time/tzdb_list/1.cc
index 587aa950277..457e3694d27 100644
--- a/libstdc++-v3/testsuite/std/time/tzdb_list/1.cc
+++ b/libstdc++-v3/testsuite/std/time/tzdb_list/1.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 
 #include <chrono>
 #include <fstream>
diff --git a/libstdc++-v3/testsuite/std/time/tzdb_list/pr118811.cc 
b/libstdc++-v3/testsuite/std/time/tzdb_list/pr118811.cc
index fe86602ecce..cdfc18f5865 100644
--- a/libstdc++-v3/testsuite/std/time/tzdb_list/pr118811.cc
+++ b/libstdc++-v3/testsuite/std/time/tzdb_list/pr118811.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 // { dg-require-static-libstdcxx "" }
 // { dg-additional-options "-static-libstdc++" }
 
diff --git a/libstdc++-v3/testsuite/std/time/tzdb_list/requirements.cc 
b/libstdc++-v3/testsuite/std/time/tzdb_list/requirements.cc
index b26704f4146..8699f3d51e7 100644
--- a/libstdc++-v3/testsuite/std/time/tzdb_list/requirements.cc
+++ b/libstdc++-v3/testsuite/std/time/tzdb_list/requirements.cc
@@ -1,5 +1,5 @@
 // { dg-do compile { target c++20 } }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 
 #include <chrono>
 
diff --git a/libstdc++-v3/testsuite/std/time/zoned_time/1.cc 
b/libstdc++-v3/testsuite/std/time/zoned_time/1.cc
index a77cd99dd55..686295c5937 100644
--- a/libstdc++-v3/testsuite/std/time/zoned_time/1.cc
+++ b/libstdc++-v3/testsuite/std/time/zoned_time/1.cc
@@ -1,6 +1,6 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target tzdb }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 
 #include <chrono>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/std/time/zoned_time/deduction.cc 
b/libstdc++-v3/testsuite/std/time/zoned_time/deduction.cc
index 05bc275f592..6a9e2354bbd 100644
--- a/libstdc++-v3/testsuite/std/time/zoned_time/deduction.cc
+++ b/libstdc++-v3/testsuite/std/time/zoned_time/deduction.cc
@@ -1,5 +1,5 @@
 // { dg-do compile { target c++20 } }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 
 #include <chrono>
 
diff --git a/libstdc++-v3/testsuite/std/time/zoned_time/io.cc 
b/libstdc++-v3/testsuite/std/time/zoned_time/io.cc
index c113eea6d3f..60887f8f9b9 100644
--- a/libstdc++-v3/testsuite/std/time/zoned_time/io.cc
+++ b/libstdc++-v3/testsuite/std/time/zoned_time/io.cc
@@ -1,5 +1,5 @@
 // { dg-do run { target c++20 } }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 // { dg-timeout-factor 2 }
 
 #include <chrono>
diff --git a/libstdc++-v3/testsuite/std/time/zoned_time/req_neg.cc 
b/libstdc++-v3/testsuite/std/time/zoned_time/req_neg.cc
index 169dc6dae5c..f0ac78f4117 100644
--- a/libstdc++-v3/testsuite/std/time/zoned_time/req_neg.cc
+++ b/libstdc++-v3/testsuite/std/time/zoned_time/req_neg.cc
@@ -1,5 +1,5 @@
 // { dg-do compile { target c++20 } }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 
 #include <chrono>
 
diff --git a/libstdc++-v3/testsuite/std/time/zoned_time/requirements.cc 
b/libstdc++-v3/testsuite/std/time/zoned_time/requirements.cc
index e7bf05e9474..9aa945a8e78 100644
--- a/libstdc++-v3/testsuite/std/time/zoned_time/requirements.cc
+++ b/libstdc++-v3/testsuite/std/time/zoned_time/requirements.cc
@@ -1,5 +1,5 @@
 // { dg-do compile { target c++20 } }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 
 #include <chrono>
 
diff --git a/libstdc++-v3/testsuite/std/time/zoned_traits.cc 
b/libstdc++-v3/testsuite/std/time/zoned_traits.cc
index 83cf6635127..763b05d862e 100644
--- a/libstdc++-v3/testsuite/std/time/zoned_traits.cc
+++ b/libstdc++-v3/testsuite/std/time/zoned_traits.cc
@@ -1,5 +1,5 @@
 // { dg-do run { target c++20 } }
-// { dg-require-effective-target cxx11_abi }
+// { dg-require-effective-target chrono_tz }
 
 #include <chrono>
 #include <testsuite_hooks.h>
-- 
2.43.0


Reply via email to