[llvm-branch-commits] [libcxx] [libc++][chrono] Fixes leap seconds. (PR #90070)

S. B. Tam via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri May 31 02:04:13 PDT 2024


================
@@ -626,29 +626,49 @@ static void __parse_leap_seconds(vector<leap_second>& __leap_seconds, istream&&
   // seconds since 1 January 1970.
   constexpr auto __offset = sys_days{1970y / January / 1} - sys_days{1900y / January / 1};
 
-  while (true) {
-    switch (__input.peek()) {
-    case istream::traits_type::eof():
-      return;
-
-    case ' ':
-    case '\t':
-    case '\n':
-      __input.get();
-      continue;
+  struct __entry {
+    sys_seconds __timestamp;
+    seconds __value;
+  };
+  vector<__entry> __entries;
+  [&] {
----------------
cpplearner wrote:

What's the purpose of wrapping the loop in an IILE?

https://github.com/llvm/llvm-project/pull/90070


More information about the llvm-branch-commits mailing list