[libcxx-commits] [libcxx] [libc++][chrono] Loads leap-seconds.list in tzdb. (PR #82113)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Mar 16 05:59:32 PDT 2024
================
@@ -0,0 +1,82 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: no-filesystem, no-localization, no-tzdb
+
+// XFAIL: libcpp-has-no-incomplete-tzdb
+// XFAIL: availability-tzdb-missing
+
+// <chrono>
+
+// class leap_second;
+
+//constexpr bool operator==(const leap_second& x, const leap_second& y); // C++20
+//constexpr strong_ordering operator<=>(const leap_second& x, const leap_second& y);
+//
+//template<class Duration>
+// constexpr bool operator==(const leap_second& x, const sys_time<Duration>& y);
+//template<class Duration>
+// constexpr bool operator< (const leap_second& x, const sys_time<Duration>& y);
+//template<class Duration>
+// constexpr bool operator< (const sys_time<Duration>& x, const leap_second& y);
+//template<class Duration>
+// constexpr bool operator> (const leap_second& x, const sys_time<Duration>& y);
+//template<class Duration>
+// constexpr bool operator> (const sys_time<Duration>& x, const leap_second& y);
+//template<class Duration>
+// constexpr bool operator<=(const leap_second& x, const sys_time<Duration>& y);
+//template<class Duration>
+// constexpr bool operator<=(const sys_time<Duration>& x, const leap_second& y);
+//template<class Duration>
+// constexpr bool operator>=(const leap_second& x, const sys_time<Duration>& y);
+//template<class Duration>
+// constexpr bool operator>=(const sys_time<Duration>& x, const leap_second& y);
+//template<class Duration>
+// requires three_way_comparable_with<sys_seconds, sys_time<Duration>>
+// constexpr auto operator<=>(const leap_second& x, const sys_time<Duration>& y);
+
+#include <cassert>
+#include <chrono>
+
+#include "test_macros.h"
+#include "test_comparisons.h"
+
+// Add the include path required by test_chrono_leap_second.h when using libc++.
+// ADDITIONAL_COMPILE_FLAGS(stdlib=libc++): -I %S/../../../../../../src/include
+#include "test_chrono_leap_second.h"
----------------
mordante wrote:
This is something we have been doing in libc++ for a long time. For example, the `test/support/test_comparisons.h` included in this file was added in 2018 by Marshall. So for now I'll keep this. If we no longer want to take this approach we should discuss it at a monthly meeting.
https://github.com/llvm/llvm-project/pull/82113
More information about the libcxx-commits
mailing list