xref: /llvm-project/libcxx/test/std/time/time.zone/time.zone.link/time.zone.link.members/name.pass.cpp (revision 2e43a304f10fd801f068d0f9831f01f2c5b0b2e2)
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_link;
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.links.size() > 1);
30 
31   std::same_as<std::string_view> auto name = tzdb.links[0].name();
32   static_assert(noexcept(tzdb.links[0].name()));
33   assert(name != tzdb.links[1].name());
34 
35   return 0;
36 }
37