diff --git a/include/gsl/narrow b/include/gsl/narrow index 32d271e..7578c8b 100644 --- a/include/gsl/narrow +++ b/include/gsl/narrow @@ -31,6 +31,10 @@ template ::value // clang-format off GSL_SUPPRESS(type.1) // NO-FORMAT: attribute GSL_SUPPRESS(f.6) // NO-FORMAT: attribute // TODO: MSVC /analyze does not recognise noexcept(false) +GSL_SUPPRESS(es.46) // NO-FORMAT: attribute // The warning suggests that a floating->unsigned conversion can occur + // in the static_cast below, and that gsl::narrow should be used instead. + // Suppress this warning, since gsl::narrow is defined in terms of + // static_cast // clang-format on constexpr T narrow(U u) noexcept(false) {