[Clang] Deprecate __is_referenceable (#123185)
[llvm-project.git] / libcxx / test / std / time / time.zone / time.zone.info / time.zone.info.sys / sys_info.members.pass.cpp
blobbfbe9b90ada64c7d23cf802e6eb2b9444ac94037
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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
11 // XFAIL: libcpp-has-no-experimental-tzdb
13 // <chrono>
15 // struct sys_info {
16 // sys_seconds begin;
17 // sys_seconds end;
18 // seconds offset;
19 // minutes save;
20 // string abbrev;
21 // };
23 // Validates whether:
24 // - The members are present as non-const members.
25 // - The struct is an aggregate.
27 #include <chrono>
28 #include <string>
29 #include <type_traits>
31 int main(int, const char**) {
32 static_assert(std::is_aggregate_v<std::chrono::sys_info>);
34 std::chrono::sys_info sys_info{
35 .begin = std::chrono::sys_seconds::min(),
36 .end = std::chrono::sys_seconds::max(),
37 .offset = std::chrono::seconds(0),
38 .save = std::chrono::minutes(0),
39 .abbrev = "UTC"};
41 [[maybe_unused]] std::chrono::sys_seconds& begin = sys_info.begin;
42 [[maybe_unused]] std::chrono::sys_seconds& end = sys_info.end;
43 [[maybe_unused]] std::chrono::seconds& offset = sys_info.offset;
44 [[maybe_unused]] std::chrono::minutes& save = sys_info.save;
45 [[maybe_unused]] std::string& abbrev = sys_info.abbrev;
47 return 0;