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: c++98, c++03, c++11, c++14
13 // constexpr optional(const optional<T>&& rhs);
14 // If is_trivially_move_constructible_v<T> is true,
15 // this constructor shall be a constexpr constructor.
18 #include <type_traits>
21 #include "test_macros.h"
24 constexpr S() : v_(0) {}
26 constexpr S(const S &rhs) : v_(rhs.v_) {} // not trivially moveable
27 constexpr S(const S &&rhs) : v_(rhs.v_) {} // not trivially moveable
34 static_assert (!std::is_trivially_move_constructible_v<S>, "" );
35 constexpr std::optional<S> o1;
36 constexpr std::optional<S> o2 = std::move(o1); // not constexpr