Debian Codegraph @

libcxx/test/std/time/time.zone/time.zone.timezone/time.zone.members/name.pass.cpp

raw
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
24 #include "test_macros.h"
25
26 int main(int, const char**) {
27 const std::chrono::tzdb& tzdb = std::chrono::get_tzdb();
28 assert(tzdb.zones.size() > 1);
29
30 [[maybe_unused]] std::same_as<std::string_view> auto _ = tzdb.zones[0].name();
31 static_assert(noexcept(tzdb.zones[0].name()));
32 assert(tzdb.zones[0].name() != tzdb.zones[1].name());
33
34 return 0;
35 }