//===----------------------------------------------------------------------===// // // 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. // //===----------------------------------------------------------------------===// // // template // T // imag(const T& x); #include #include #include #include "../cases.h" template void test(typename std::enable_if::value>::type* = 0) { static_assert((std::is_same::value), ""); assert(std::imag(x) == 0); #if _LIBCPP_STD_VER > 11 constexpr T val {x}; static_assert(std::imag(val) == 0, ""); constexpr std::complex t{val, val}; static_assert(t.imag() == x, "" ); #endif } template void test(typename std::enable_if::value>::type* = 0) { static_assert((std::is_same::value), ""); assert(std::imag(x) == 0); #if _LIBCPP_STD_VER > 11 constexpr T val {x}; static_assert(std::imag(val) == 0, ""); constexpr std::complex t{val, val}; static_assert(t.imag() == x, "" ); #endif } template void test() { test(); test(); test(); } int main() { test(); test(); test(); test(); test(); test(); }