| 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 | // <complex> |
| 10 | |
| 11 | // template<class T> |
| 12 | // class complex |
| 13 | // { |
| 14 | // public: |
| 15 | // typedef T value_type; |
| 16 | // ... |
| 17 | // }; |
| 18 | |
| 19 | #include <complex> |
| 20 | #include <type_traits> |
| 21 | |
| 22 | #include "test_macros.h" |
| 23 | |
| 24 | template <class T> |
| 25 | void |
| 26 | test() |
| 27 | { |
| 28 | typedef std::complex<T> C; |
| 29 | static_assert((std::is_same<typename C::value_type, T>::value), "" ); |
| 30 | } |
| 31 | |
| 32 | int main(int, char**) |
| 33 | { |
| 34 | test<float>(); |
| 35 | test<double>(); |
| 36 | test<long double>(); |
| 37 | |
| 38 | return 0; |
| 39 | } |
| 40 | |