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: c++03, c++11, c++14, c++17, c++20
11 // constexpr explicit expected(in_place_t) noexcept;
15 #include <type_traits>
19 static_assert(std::is_constructible_v
<std::expected
<void, int>, std::in_place_t
>);
20 static_assert(!std::is_convertible_v
<std::in_place_t
, std::expected
<void, int>>);
23 static_assert(std::is_nothrow_constructible_v
<std::expected
<void, int>, std::in_place_t
>);
25 constexpr bool test() {
26 std::expected
<void, int> e(std::in_place
);
27 assert(e
.has_value());
32 int main(int, char**) {
34 static_assert(test());