//===----------------------------------------------------------------------===// // // 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 // // template // class zoned_time; // // TimeZonePtr get_time_zone() const; #include #include #include #include "../test_offset_time_zone.h" int main(int, char**) { { const std::chrono::time_zone* tz = std::chrono::locate_zone("UTC"); std::chrono::zoned_time zt{tz}; std::same_as decltype(auto) ptr = zt.get_time_zone(); assert(ptr = tz); } { int tz = 0; std::chrono::zoned_time zt{&tz}; std::same_as decltype(auto) ptr = zt.get_time_zone(); assert(ptr = &tz); } { int tz = 0; const std::chrono::zoned_time zt{&tz}; std::same_as decltype(auto) ptr = zt.get_time_zone(); assert(ptr = &tz); } return 0; }