[libcxx-commits] [libcxx] [libc++][TZDB] Finishes zoned_time member functions. (PR #95026)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jul 9 22:49:49 PDT 2024
================
@@ -0,0 +1,133 @@
+//===----------------------------------------------------------------------===//
+//
+// 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-experimental-tzdb
+// XFAIL: availability-tzdb-missing
+
+// <chrono>
+
+// template<class Duration, class TimeZonePtr = const time_zone*>
+// class zoned_time;
+//
+// local_time<duration> get_local_time() const;
+
+#include <chrono>
+#include <concepts>
+
+#include "../test_offset_time_zone.h"
+
+namespace cr = std::chrono;
+
+static void test_const_member() {
+ {
+ using duration = cr::nanoseconds;
+ using time_point = cr::sys_time<duration>;
+ using local_time_point = cr::local_time<duration>;
+ cr::zoned_time<duration> zt{"Etc/GMT+1", time_point{duration{42}}};
----------------
mordante wrote:
I adjusted the name of the function to better show its purpose.
https://github.com/llvm/llvm-project/pull/95026
More information about the libcxx-commits
mailing list