summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/numerics/complex.number/complex.special/float_double_implicit.fail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/std/numerics/complex.number/complex.special/float_double_implicit.fail.cpp')
-rw-r--r--libcxx/test/std/numerics/complex.number/complex.special/float_double_implicit.fail.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/libcxx/test/std/numerics/complex.number/complex.special/float_double_implicit.fail.cpp b/libcxx/test/std/numerics/complex.number/complex.special/float_double_implicit.fail.cpp
new file mode 100644
index 00000000000..d1519753285
--- /dev/null
+++ b/libcxx/test/std/numerics/complex.number/complex.special/float_double_implicit.fail.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <complex>
+
+// template<> class complex<float>
+// {
+// public:
+// explicit constexpr complex(const complex<double>&);
+// };
+
+#include <complex>
+#include <cassert>
+
+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());
+}
OpenPOWER on IntegriCloud