summaryrefslogtreecommitdiffstats
path: root/libcxx/test/libcxx/time/time.zone/time.zone.timezone/choose.pass.cpp
blob: 24424b0a2e2b0d328828f47887221d65eb65d5af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: no-filesystem, no-localization, no-tzdb

// XFAIL: libcpp-has-no-experimental-tzdb
// XFAIL: availability-tzdb-missing

// <chrono>

// enaum class choose;

#include <chrono>
#include <type_traits>
#include <cassert>

#include "test_macros.h"

int main(int, char**) {
  using E = std::chrono::choose;
  static_assert(std::is_enum_v<E>);

  // Check that E is a scoped enum by checking for conversions.
  using UT = std::underlying_type_t<E>;
  static_assert(!std::is_convertible_v<E, UT>);

  [[maybe_unused]] const E& early = E::earliest;
  [[maybe_unused]] const E& late  = E::latest;

  return 0;
}