15a83710eSEric Fiselier //===----------------------------------------------------------------------===//
25a83710eSEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65a83710eSEric Fiselier //
75a83710eSEric Fiselier //===----------------------------------------------------------------------===//
85a83710eSEric Fiselier //
9*a7f9895cSLouis Dionne // UNSUPPORTED: no-threads
105a83710eSEric Fiselier
1131cbe0f2SLouis Dionne // UNSUPPORTED: c++03
1219cf6b6cSEric Fiselier // Libc++'s enum class emulation does not allow static_cast<Enum>(0) to work.
1319cf6b6cSEric Fiselier
145a83710eSEric Fiselier // <future>
155a83710eSEric Fiselier
165a83710eSEric Fiselier // enum class future_errc
175a83710eSEric Fiselier // {
18d3c2acd3SEric Fiselier // broken_promise = implementation-defined,
19d3c2acd3SEric Fiselier // future_already_retrieved = implementation-defined,
20d3c2acd3SEric Fiselier // promise_already_satisfied = implementation-defined,
21d3c2acd3SEric Fiselier // no_state = implementation-defined
225a83710eSEric Fiselier // };
235a83710eSEric Fiselier
245a83710eSEric Fiselier #include <future>
255a83710eSEric Fiselier
267fc6a556SMarshall Clow #include "test_macros.h"
277fc6a556SMarshall Clow
main(int,char **)282df59c50SJF Bastien int main(int, char**)
295a83710eSEric Fiselier {
30d3c2acd3SEric Fiselier static_assert(std::future_errc::broken_promise != std::future_errc::future_already_retrieved, "");
31d3c2acd3SEric Fiselier static_assert(std::future_errc::broken_promise != std::future_errc::promise_already_satisfied, "");
32d3c2acd3SEric Fiselier static_assert(std::future_errc::broken_promise != std::future_errc::no_state, "");
33d3c2acd3SEric Fiselier static_assert(std::future_errc::future_already_retrieved != std::future_errc::promise_already_satisfied, "");
34d3c2acd3SEric Fiselier static_assert(std::future_errc::future_already_retrieved != std::future_errc::no_state, "");
35d3c2acd3SEric Fiselier static_assert(std::future_errc::promise_already_satisfied != std::future_errc::no_state, "");
36d3c2acd3SEric Fiselier
37d3c2acd3SEric Fiselier static_assert(std::future_errc::broken_promise != static_cast<std::future_errc>(0), "");
38d3c2acd3SEric Fiselier static_assert(std::future_errc::future_already_retrieved != static_cast<std::future_errc>(0), "");
39d3c2acd3SEric Fiselier static_assert(std::future_errc::promise_already_satisfied != static_cast<std::future_errc>(0), "");
40d3c2acd3SEric Fiselier static_assert(std::future_errc::no_state != static_cast<std::future_errc>(0), "");
412df59c50SJF Bastien
422df59c50SJF Bastien return 0;
435a83710eSEric Fiselier }
44