• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // UNSUPPORTED: libcpp-has-no-threads
11 
12 // UNSUPPORTED: c++98, c++03
13 // Libc++'s enum class emulation does not allow static_cast<Enum>(0) to work.
14 
15 // <future>
16 
17 // enum class future_errc
18 // {
19 //     broken_promise = implementation-defined,
20 //     future_already_retrieved = implementation-defined,
21 //     promise_already_satisfied = implementation-defined,
22 //     no_state = implementation-defined
23 // };
24 
25 #include <future>
26 
main()27 int main()
28 {
29     static_assert(std::future_errc::broken_promise != std::future_errc::future_already_retrieved, "");
30     static_assert(std::future_errc::broken_promise != std::future_errc::promise_already_satisfied, "");
31     static_assert(std::future_errc::broken_promise != std::future_errc::no_state, "");
32     static_assert(std::future_errc::future_already_retrieved != std::future_errc::promise_already_satisfied, "");
33     static_assert(std::future_errc::future_already_retrieved != std::future_errc::no_state, "");
34     static_assert(std::future_errc::promise_already_satisfied != std::future_errc::no_state, "");
35 
36     static_assert(std::future_errc::broken_promise != static_cast<std::future_errc>(0), "");
37     static_assert(std::future_errc::future_already_retrieved != static_cast<std::future_errc>(0), "");
38     static_assert(std::future_errc::promise_already_satisfied != static_cast<std::future_errc>(0), "");
39     static_assert(std::future_errc::no_state != static_cast<std::future_errc>(0), "");
40 }
41