diff --git a/clang/lib/Headers/__clang_hip_cmath.h b/clang/lib/Headers/__clang_hip_cmath.h index acb46c81db58a..8dbde4291fff5 100644 --- a/clang/lib/Headers/__clang_hip_cmath.h +++ b/clang/lib/Headers/__clang_hip_cmath.h @@ -464,12 +464,13 @@ class __promote : public __promote_imp<_A1, _A2, _A3> {}; #if __cplusplus >= 201103L #define __HIP_OVERLOAD2(__retty, __fn) \ template \ - __DEVICE__ __CONSTEXPR__ typename __hip_enable_if< \ - __hip::is_arithmetic<__T1>::value && __hip::is_arithmetic<__T2>::value, \ - typename __hip::__promote<__T1, __T2>::type>::type \ - __fn(__T1 __x, __T2 __y) { \ - typedef typename __hip::__promote<__T1, __T2>::type __result_type; \ - return __fn((__result_type)__x, (__result_type)__y); \ + __DEVICE__ __CONSTEXPR__ \ + typename __hip_enable_if<__hip::is_arithmetic<__T1>::value && \ + __hip::is_arithmetic<__T2>::value, \ + __retty>::type \ + __fn(__T1 __x, __T2 __y) { \ + typedef typename __hip::__promote<__T1, __T2>::type __arg_type; \ + return __fn((__arg_type)__x, (__arg_type)__y); \ } #else #define __HIP_OVERLOAD2(__retty, __fn) \ diff --git a/clang/test/Headers/__clang_hip_cmath-return_types.hip b/clang/test/Headers/__clang_hip_cmath-return_types.hip index e8f14d6b51a9b..146235244c45f 100644 --- a/clang/test/Headers/__clang_hip_cmath-return_types.hip +++ b/clang/test/Headers/__clang_hip_cmath-return_types.hip @@ -376,19 +376,19 @@ __device__ void test_isnormal() __device__ void test_isgreater() { static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); static_assert(is_same::value, ""); - static_assert(is_same::value, ""); + static_assert(is_same::value, ""); } __device__ void test_isgreaterequal() { static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); static_assert(is_same::value, ""); - static_assert(is_same::value, ""); + static_assert(is_same::value, ""); } __device__ void test_isinf() @@ -400,28 +400,28 @@ __device__ void test_isinf() __device__ void test_isless() { static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); static_assert(is_same::value, ""); - static_assert(is_same::value, ""); + static_assert(is_same::value, ""); } __device__ void test_islessequal() { static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); static_assert(is_same::value, ""); - static_assert(is_same::value, ""); + static_assert(is_same::value, ""); } __device__ void test_islessgreater() { static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); static_assert(is_same::value, ""); - static_assert(is_same::value, ""); + static_assert(is_same::value, ""); } __device__ void test_isnan() @@ -433,10 +433,10 @@ __device__ void test_isnan() __device__ void test_isunordered() { static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); static_assert(is_same::value, ""); - static_assert(is_same::value, ""); + static_assert(is_same::value, ""); } __device__ void test_acosh()