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 //===----------------------------------------------------------------------===//
13 #include <type_traits>
14 #include "test_macros.h"
17 void test_is_copy_assignable()
19 static_assert(( std::is_copy_assignable
<T
>::value
), "");
21 static_assert(( std::is_copy_assignable_v
<T
>), "");
26 void test_is_not_copy_assignable()
28 static_assert((!std::is_copy_assignable
<T
>::value
), "");
30 static_assert((!std::is_copy_assignable_v
<T
>), "");
58 B
& operator=(const B
&);
63 void operator=(C
&); // not const
68 test_is_copy_assignable
<int> ();
69 test_is_copy_assignable
<int&> ();
70 test_is_copy_assignable
<A
> ();
71 test_is_copy_assignable
<bit_zero
> ();
72 test_is_copy_assignable
<Union
> ();
73 test_is_copy_assignable
<NotEmpty
> ();
74 test_is_copy_assignable
<Empty
> ();
76 #if TEST_STD_VER >= 11
77 test_is_not_copy_assignable
<const int> ();
78 test_is_not_copy_assignable
<int[]> ();
79 test_is_not_copy_assignable
<int[3]> ();
80 test_is_not_copy_assignable
<B
> ();
82 test_is_not_copy_assignable
<void> ();
83 test_is_not_copy_assignable
<C
> ();