1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // UNSUPPORTED: c++03, c++11, c++14, c++17 10 // UNSUPPORTED: no-filesystem, no-localization, no-tzdb 11 12 // XFAIL: libcpp-has-no-experimental-tzdb 13 // XFAIL: availability-tzdb-missing 14 15 // <chrono> 16 17 // class time_zone; 18 19 // string_view name() const noexcept; 20 21 #include <cassert> 22 #include <chrono> 23 #include <concepts> 24 25 #include "test_macros.h" 26 27 int main(int, const char**) { 28 const std::chrono::tzdb& tzdb = std::chrono::get_tzdb(); 29 assert(tzdb.zones.size() > 1); 30 31 [[maybe_unused]] std::same_as<std::string_view> auto _ = tzdb.zones[0].name(); 32 static_assert(noexcept(tzdb.zones[0].name())); 33 assert(tzdb.zones[0].name() != tzdb.zones[1].name()); 34 35 return 0; 36 } 37