summaryrefslogtreecommitdiffstats
path: root/libcxx/test/numerics/complex.number/complex.special/float_double_explicit.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/numerics/complex.number/complex.special/float_double_explicit.pass.cpp')
-rw-r--r--libcxx/test/numerics/complex.number/complex.special/float_double_explicit.pass.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libcxx/test/numerics/complex.number/complex.special/float_double_explicit.pass.cpp b/libcxx/test/numerics/complex.number/complex.special/float_double_explicit.pass.cpp
index 01002b35e16..77ca9d7f2aa 100644
--- a/libcxx/test/numerics/complex.number/complex.special/float_double_explicit.pass.cpp
+++ b/libcxx/test/numerics/complex.number/complex.special/float_double_explicit.pass.cpp
@@ -20,8 +20,18 @@
int main()
{
+ {
const std::complex<double> cd(2.5, 3.5);
std::complex<float> 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<float> cf(cd);
+ static_assert(cf.real() == cd.real(), "");
+ static_assert(cf.imag() == cd.imag(), "");
+ }
+#endif
}
OpenPOWER on IntegriCloud