https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127815

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
No, more like this:

--- a/libstdc++-v3/src/c++20/tzdb.cc
+++ b/libstdc++-v3/src/c++20/tzdb.cc
@@ -1085,7 +1085,11 @@ namespace std::chrono
     sys_info info;

     if (i == infos.begin())
-      info.begin = sys_days(year::min()/January/1);
+      {
+       info.begin = sys_days(year::min()/January/1);
+       if (chrono::time_point_cast<days>(tp) < info.begin)
+         tp = info.begin;
+      }
     else
       info.begin = i[-1].until();

@@ -1106,7 +1110,7 @@ namespace std::chrono
       __throw_runtime_error("std::chrono::time_zone::get_info: invalid data");

     vector<pair<sys_info, string_view>> new_infos;
-    if (int n = ceil<years>(tp - info.begin).count())
+    if (int n = ceil<years>(chrono::abs(tp - info.begin)).count())
       new_infos.reserve(std::min(100, n * 2));
     long result_index = -1;
     int num_after = 4; // number of sys_info to generate past tp.

Reply via email to