diff options
Diffstat (limited to 'libcxx/test/numerics/complex.number/complex.special/long_double_double_implicit.pass.cpp')
-rw-r--r-- | libcxx/test/numerics/complex.number/complex.special/long_double_double_implicit.pass.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libcxx/test/numerics/complex.number/complex.special/long_double_double_implicit.pass.cpp b/libcxx/test/numerics/complex.number/complex.special/long_double_double_implicit.pass.cpp index 14eff25e7b4..aab539407d0 100644 --- a/libcxx/test/numerics/complex.number/complex.special/long_double_double_implicit.pass.cpp +++ b/libcxx/test/numerics/complex.number/complex.special/long_double_double_implicit.pass.cpp @@ -20,8 +20,18 @@ int main() { + { const std::complex<double> cd(2.5, 3.5); std::complex<long double> cf = cd; assert(cf.real() == cd.real()); assert(cf.imag() == cd.imag()); + } +#ifndef _LIBCPP_HAS_NO_CONSTEXPR + { + constexpr std::complex<double> cd(2.5, 3.5); + constexpr std::complex<long double> cf = cd; + static_assert(cf.real() == cd.real(), ""); + static_assert(cf.imag() == cd.imag(), ""); + } +#endif } |