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 T& rhs); // constexpr in C++20
16 #include "test_macros.h"
24 assert(c
.real() == 1);
25 assert(c
.imag() == 0);
27 assert(c
.real() == 1.5);
28 assert(c
.imag() == 0);
30 assert(c
.real() == 2.25);
31 assert(c
.imag() == 0);
33 assert(c
.real() == -3.375);
34 assert(c
.imag() == 0);
37 assert(c
.real() == -5.0625);
38 assert(c
.imag() == 3);
48 #if TEST_STD_VER >= 20
49 static_assert(test
<float>());
50 static_assert(test
<double>());
51 static_assert(test
<long double>());