@@ -256,7 +256,7 @@ _CCCL_REQUIRES((::cuda::std::is_void_v<_Result> || ::cuda::std::__cccl_is_intege
256256[[nodiscard]]
257257_CCCL_API constexpr overflow_result<_ActualResult> add_overflow(const _Lhs __lhs, const _Rhs __rhs) noexcept
258258{
259- using ::cuda::std::is_signed_v ;
259+ using ::cuda::std::is_same_v ;
260260
261261 // We want to use __builtin_add_overflow only in host code. When compiling CUDA source file, we cannot use it in
262262 // constant expressions, because it doesn't work before nvcc 13.1 and is buggy in 13.1. When compiling C++ source
@@ -269,7 +269,7 @@ _CCCL_API constexpr overflow_result<_ActualResult> add_overflow(const _Lhs __lhs
269269 // nvc++ doesn't support overflow builtins for 128-bit integers of different signedness.
270270# if _CCCL_COMPILER(NVHPC)
271271 if constexpr ((sizeof (_ActualResult) != 16 && sizeof (_Lhs) != 16 && sizeof (_Rhs) != 16 )
272- || (is_signed_v <_ActualResult> == is_signed_v< _Lhs> == is_signed_v< _Rhs>) )
272+ || (is_same_v <_ActualResult, _Lhs> && is_same_v<_ActualResult, _Rhs>) )
273273# endif // _CCCL_COMPILER(NVHPC)
274274 {
275275 NV_IF_TARGET (NV_IS_HOST, ({
@@ -286,7 +286,7 @@ _CCCL_API constexpr overflow_result<_ActualResult> add_overflow(const _Lhs __lhs
286286 using ::cuda::std::__make_nbit_int_t ;
287287 using ::cuda::std::__make_nbit_uint_t ;
288288 using ::cuda::std::__num_bits_v;
289- using ::cuda::std::is_same_v ;
289+ using ::cuda::std::is_signed_v ;
290290 using ::cuda::std::is_unsigned_v;
291291 using _CommonAll = ::cuda::std::common_type_t <_Common, _ActualResult>;
292292 [[maybe_unused]] const bool __is_lhs_ge_zero = is_unsigned_v<_Lhs> || __lhs >= 0 ;
0 commit comments