1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
11 // complex& operator/=(const complex& rhs); // constexpr in C++20
16 #include "test_macros.h"
23 std::complex<T
> c(-4, 7.5);
24 const std::complex<T
> c2(1.5, 2.5);
25 assert(c
.real() == -4);
26 assert(c
.imag() == 7.5);
28 assert(c
.real() == 1.5);
29 assert(c
.imag() == 2.5);
31 assert(c
.real() == 1);
32 assert(c
.imag() == 0);
37 std::complex<int> ic (1,1);
39 assert(c3
.real() == 0.5);
40 assert(c3
.imag() == -0.5);
43 std::complex<float> fc (1,1);
45 assert(c3
.real() == 0.5);
46 assert(c3
.imag() == -0.5);
56 #if TEST_STD_VER >= 20
57 static_assert(test
<float>());
58 static_assert(test
<double>());
59 static_assert(test
<long double>());