diff --git a/include/fmt/core.h b/include/fmt/core.h index b5156e20..fd4350e7 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -117,8 +117,8 @@ # endif #endif -// [[noreturn]] is disabled on MSVC because of bogus unreachable code warnings. -#if FMT_EXCEPTIONS && FMT_HAS_CPP_ATTRIBUTE(noreturn) && !FMT_MSC_VER +// [[noreturn]] is disabled on MSVC and NVCC because of bogus unreachable code warnings. +#if FMT_EXCEPTIONS && FMT_HAS_CPP_ATTRIBUTE(noreturn) && !FMT_MSC_VER && !FMT_NVCC # define FMT_NORETURN [[noreturn]] #else # define FMT_NORETURN diff --git a/include/fmt/format.h b/include/fmt/format.h index bec24906..1620e635 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -86,12 +86,12 @@ #ifndef FMT_THROW # if FMT_EXCEPTIONS -# if FMT_MSC_VER +# if FMT_MSC_VER || FMT_NVCC FMT_BEGIN_NAMESPACE namespace internal { template inline void do_throw(const Exception& x) { - // Silence unreachable code warnings in MSVC because these are nearly - // impossible to fix in a generic code. + // Silence unreachable code warnings in MSVC and NVCC because these + // are nearly impossible to fix in a generic code. volatile bool b = true; if (b) throw x; }