[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
Wed Mar 27 12:47:25 PDT 2024


================
@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+// {
+//   leap_second& operator=(const leap_second&) = default;
+//
+//   ...
+// };
+
+#include <chrono>
+#include <memory>
+#include <type_traits>
+#include <cassert>
+
+// Add the include path required by test_chrono_leap_second.h when using libc++.
+// ADDITIONAL_COMPILE_FLAGS(stdlib=libc++): -I %S/../../../../../src/include
----------------
mordante wrote:

> I disagree that implementations are allowed to add move constructors. The leap second object does not have a "moved from" state, and implementations should not have different behavior here.

It would be Standard conforming, from a QoI PoV I expect nobody to do it.
I can add the test with a libc++ specific `static_assert`, the same for default constructible.

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


More information about the libcxx-commits mailing list