1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
11 // XFAIL: libcpp-has-no-experimental-tzdb
15 // struct local_info {
16 // static constexpr int unique = 0;
17 // static constexpr int nonexistent = 1;
18 // static constexpr int ambiguous = 2;
26 // - The static members are present as static constexpr members.
27 // - The members are present as non-const members.
28 // - The struct is an aggregate.
32 #include <type_traits>
34 int main(int, const char**) {
36 constexpr const int& result
= std::chrono::local_info::unique
;
37 static_assert(result
== 0);
40 constexpr const int& result
= std::chrono::local_info::nonexistent
;
41 static_assert(result
== 1);
44 constexpr const int& result
= std::chrono::local_info::ambiguous
;
45 static_assert(result
== 2);
48 static_assert(std::is_aggregate_v
<std::chrono::local_info
>);
50 std::chrono::local_info local_info
{.result
= 0, .first
= std::chrono::sys_info
{}, .second
= std::chrono::sys_info
{}};
52 [[maybe_unused
]] int& result
= local_info
.result
;
53 [[maybe_unused
]] std::chrono::sys_info
& first
= local_info
.first
;
54 [[maybe_unused
]] std::chrono::sys_info
& second
= local_info
.second
;