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 //===----------------------------------------------------------------------===//
11 // has_nothrow_move_constructor
13 #include <type_traits>
14 #include "test_macros.h"
19 void test_is_nothrow_move_constructible()
21 static_assert( std::is_nothrow_move_constructible
<T
>::value
, "");
22 static_assert( std::is_nothrow_move_constructible
<const T
>::value
, "");
24 static_assert( std::is_nothrow_move_constructible_v
<T
>, "");
25 static_assert( std::is_nothrow_move_constructible_v
<const T
>, "");
30 void test_has_not_nothrow_move_constructor()
32 static_assert(!std::is_nothrow_move_constructible
<T
>::value
, "");
33 static_assert(!std::is_nothrow_move_constructible
<const T
>::value
, "");
34 static_assert(!std::is_nothrow_move_constructible
<volatile T
>::value
, "");
35 static_assert(!std::is_nothrow_move_constructible
<const volatile T
>::value
, "");
37 static_assert(!std::is_nothrow_move_constructible_v
<T
>, "");
38 static_assert(!std::is_nothrow_move_constructible_v
<const T
>, "");
39 static_assert(!std::is_nothrow_move_constructible_v
<volatile T
>, "");
40 static_assert(!std::is_nothrow_move_constructible_v
<const volatile T
>, "");
46 test_has_not_nothrow_move_constructor
<void>();
47 test_has_not_nothrow_move_constructor
<A
>();
48 // TODO: enable the test for GCC once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106611 is resolved
49 #if TEST_STD_VER >= 11 && !defined(TEST_COMPILER_GCC)
50 test_has_not_nothrow_move_constructor
<TrivialNotNoexcept
>();
53 test_is_nothrow_move_constructible
<int&>();
54 test_is_nothrow_move_constructible
<Union
>();
55 test_is_nothrow_move_constructible
<Empty
>();
56 test_is_nothrow_move_constructible
<int>();
57 test_is_nothrow_move_constructible
<double>();
58 test_is_nothrow_move_constructible
<int*>();
59 test_is_nothrow_move_constructible
<const int*>();
60 test_is_nothrow_move_constructible
<bit_zero
>();