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 // explicit bad_expected_access(E e);
13 // Effects: Initializes unex with std::move(e).
20 #include "test_macros.h"
24 static_assert(std::convertible_to
<int, int>);
25 static_assert(!std::convertible_to
<int, std::bad_expected_access
<int>>);
27 int main(int, char**) {
28 std::bad_expected_access
<MoveOnly
> b(MoveOnly
{3});
29 assert(b
.error().get() == 3);