1 | //===----------------------------------------------------------------------===// |
2 | // |
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 |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | // |
9 | // UNSUPPORTED: c++03, c++11, c++14, c++17 |
10 | |
11 | // atomic(const atomic&) = delete; |
12 | // atomic& operator=(const atomic&) = delete; |
13 | // atomic& operator=(const atomic&) volatile = delete; |
14 | |
15 | #include <atomic> |
16 | #include <type_traits> |
17 | |
18 | template <class T> |
19 | void test() { |
20 | static_assert(!std::is_copy_assignable_v<std::atomic<T>>); |
21 | static_assert(!std::is_copy_constructible_v<std::atomic<T>>); |
22 | static_assert(!std::is_move_constructible_v<std::atomic<T>>); |
23 | static_assert(!std::is_move_assignable_v<std::atomic<T>>); |
24 | static_assert(!std::is_assignable_v<volatile std::atomic<T>&, const std::atomic<T>&>); |
25 | } |
26 | |
27 | template void test<float>(); |
28 | template void test<double>(); |
29 | template void test<long double>(); |
30 | |