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_assign
13 #include <type_traits>
14 #include "test_macros.h"
19 void test_has_nothrow_assign()
21 static_assert( std::is_nothrow_move_assignable
<T
>::value
, "");
23 static_assert( std::is_nothrow_move_assignable_v
<T
>, "");
28 void test_has_not_nothrow_assign()
30 static_assert(!std::is_nothrow_move_assignable
<T
>::value
, "");
32 static_assert(!std::is_nothrow_move_assignable_v
<T
>, "");
38 test_has_nothrow_assign
<int&>();
39 test_has_nothrow_assign
<Union
>();
40 test_has_nothrow_assign
<Empty
>();
41 test_has_nothrow_assign
<int>();
42 test_has_nothrow_assign
<double>();
43 test_has_nothrow_assign
<int*>();
44 test_has_nothrow_assign
<const int*>();
45 test_has_nothrow_assign
<NotEmpty
>();
46 test_has_nothrow_assign
<bit_zero
>();
48 test_has_not_nothrow_assign
<void>();
49 test_has_not_nothrow_assign
<A
>();
50 // TODO: enable the test for GCC once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106611 is resolved
51 #if TEST_STD_VER >= 11 && !defined(TEST_COMPILER_GCC)
52 test_has_not_nothrow_assign
<TrivialNotNoexcept
>();