1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-exceptions
10 // UNSUPPORTED: no-threads
17 // void set_exception(exception_ptr p);
22 #include "test_macros.h"
29 std::future
<T
> f
= p
.get_future();
30 p
.set_exception(std::make_exception_ptr(3));
42 p
.set_exception(std::make_exception_ptr(3));
45 catch (const std::future_error
& e
)
47 assert(e
.code() == make_error_code(std::future_errc::promise_already_satisfied
));