1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // UNSUPPORTED: libcpp-has-no-threads
12 // LWG 2056 changed the values of future_errc, so if we're using new headers
13 // with an old library we'll get incorrect messages.
15 // XFAIL: with_system_cxx_lib=macosx10.11
16 // XFAIL: with_system_cxx_lib=macosx10.10
17 // XFAIL: with_system_cxx_lib=macosx10.9
18 // XFAIL: with_system_cxx_lib=macosx10.7
19 // XFAIL: with_system_cxx_lib=macosx10.8
25 // const char* what() const throw();
31 #include "test_macros.h"
36 std::future_error f(std::make_error_code(std::future_errc::broken_promise));
37 LIBCPP_ASSERT(std::strcmp(f.what(), "The associated promise has been destructed prior "
38 "to the associated state becoming ready.") == 0);
41 std::future_error f(std::make_error_code(std::future_errc::future_already_retrieved));
42 LIBCPP_ASSERT(std::strcmp(f.what(), "The future has already been retrieved from "
43 "the promise or packaged_task.") == 0);
46 std::future_error f(std::make_error_code(std::future_errc::promise_already_satisfied));
47 LIBCPP_ASSERT(std::strcmp(f.what(), "The state of the promise has already been set.") == 0);
50 std::future_error f(std::make_error_code(std::future_errc::no_state));
51 LIBCPP_ASSERT(std::strcmp(f.what(), "Operation not permitted on an object without "
52 "an associated state.") == 0);