1//===----------------------------------------------------------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <complex>
11
12// template<> class complex<long double>
13// {
14// public:
15//     constexpr complex(const complex<float>&);
16// };
17
18#include <complex>
19#include <cassert>
20
21#include "test_macros.h"
22
23int main()
24{
25    {
26    const std::complex<float> cd(2.5, 3.5);
27    std::complex<long double> cf = cd;
28    assert(cf.real() == cd.real());
29    assert(cf.imag() == cd.imag());
30    }
31#if TEST_STD_VER >= 11
32    {
33    constexpr std::complex<float> cd(2.5, 3.5);
34    constexpr std::complex<long double> cf = cd;
35    static_assert(cf.real() == cd.real(), "");
36    static_assert(cf.imag() == cd.imag(), "");
37    }
38#endif
39}
40