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 | // using value_type = floating-point-type; |
12 | // using difference_type = value_type; |
13 | // The atomic floating-point specializations are standard-layout structs. They each have a trivial destructor. |
14 | |
15 | #include <atomic> |
16 | #include <type_traits> |
17 | |
18 | template <class T> |
19 | void test() { |
20 | static_assert(std::is_same_v<typename std::atomic<T>::value_type, T>); |
21 | static_assert(std::is_same_v<typename std::atomic<T>::difference_type, T>); |
22 | static_assert(std::is_standard_layout_v<std::atomic<T>>); |
23 | static_assert(std::is_trivially_destructible_v<std::atomic<T>>); |
24 | } |
25 | |
26 | template void test<float>(); |
27 | template void test<double>(); |
28 | template void test<long double>(); |
29 | |