diff --git a/clang/lib/Headers/__clang_hip_cmath.h b/clang/lib/Headers/__clang_hip_cmath.h index 071c64c7af8d5b..e04fc7824b1771 100644 --- a/clang/lib/Headers/__clang_hip_cmath.h +++ b/clang/lib/Headers/__clang_hip_cmath.h @@ -397,7 +397,12 @@ template struct __numeric_type { // No support for long double, use double instead. static double __test(long double); - typedef decltype(__test(declval<_Tp>())) type; + template + static auto __test_impl(int) -> decltype(__test(declval<_U>())); + + template static void __test_impl(...); + + typedef decltype(__test_impl<_Tp>(0)) type; static const bool value = !is_same::value; };