diff --git a/mfbt/CheckedInt.h b/mfbt/CheckedInt.h index 7398fb99ddfa..1dc80b032bb3 100644 --- a/mfbt/CheckedInt.h +++ b/mfbt/CheckedInt.h @@ -561,7 +561,8 @@ class CheckedInt template CheckedInt(U value, bool isValid) : mValue(value), mIsValid(isValid) { - MOZ_STATIC_ASSERT(detail::IsSupported::value, + MOZ_STATIC_ASSERT(detail::IsSupported::value && + detail::IsSupported::value, "This type is not supported by CheckedInt"); } @@ -584,7 +585,8 @@ class CheckedInt : mValue(T(value)), mIsValid(detail::IsInRange(value)) { - MOZ_STATIC_ASSERT(detail::IsSupported::value, + MOZ_STATIC_ASSERT(detail::IsSupported::value && + detail::IsSupported::value, "This type is not supported by CheckedInt"); } @@ -755,6 +757,9 @@ template inline typename detail::CastToCheckedIntImpl::ReturnType castToCheckedInt(U u) { + MOZ_STATIC_ASSERT(detail::IsSupported::value && + detail::IsSupported::value, + "This type is not supported by CheckedInt"); return detail::CastToCheckedIntImpl::run(u); }