diff --git a/libcudacxx/include/cuda/std/__cccl/assert.h b/libcudacxx/include/cuda/std/__cccl/assert.h index ddb1b798137..7ff2ea16f84 100644 --- a/libcudacxx/include/cuda/std/__cccl/assert.h +++ b/libcudacxx/include/cuda/std/__cccl/assert.h @@ -24,6 +24,7 @@ #include #include +#include #if !defined(_CCCL_COMPILER_NVRTC) # include @@ -68,9 +69,14 @@ #else // ^^^ MSVC STL ^^^ / vvv !MSVC STL vvv # ifdef NDEBUG // Reintroduce the __assert_fail declaration -extern void -__assert_fail(const char* __assertion, const char* __file, unsigned int __line, const char* __function) __THROW +extern "C" { +# if !defined(_CCCL_CUDA_COMPILER_CLANG) +_CCCL_HOST_DEVICE +# endif // !_CCCL_CUDA_COMPILER_CLANG +void +__assert_fail(const char* __assertion, const char* __file, unsigned int __line, const char* __function) noexcept __attribute__((__noreturn__)); +} # endif // NDEBUG // ICC cannot deal with `__builtin_expect` in the constexpr evaluator, so just drop it # if defined(_CCCL_COMPILER_ICC)