make_error_code.pass.cpp 826 B

12345678910111213141516171819202122232425262728293031
  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. //===----------------------------------------------------------------------===//
  8. //
  9. // UNSUPPORTED: libcpp-has-no-threads
  10. // <future>
  11. // class error_code
  12. // error_code make_error_code(future_errc e);
  13. #include <future>
  14. #include <cassert>
  15. #include "test_macros.h"
  16. int main(int, char**)
  17. {
  18. {
  19. std::error_code ec = make_error_code(std::future_errc::broken_promise);
  20. assert(ec.value() == static_cast<int>(std::future_errc::broken_promise));
  21. assert(ec.category() == std::future_category());
  22. }
  23. return 0;
  24. }