diff --git a/3rdParty/opencv2/core/types.hpp b/3rdParty/opencv2/core/types.hpp index fc9ed18820..f69e499f36 100644 --- a/3rdParty/opencv2/core/types.hpp +++ b/3rdParty/opencv2/core/types.hpp @@ -1851,8 +1851,10 @@ template inline _Tp Rect_<_Tp>::area() const { const _Tp result = width * height; - CV_DbgAssert(!std::numeric_limits<_Tp>::is_integer - || width == 0 || result / width == height); // make sure the result fits in the return value + if constexpr (std::numeric_limits<_Tp>::is_integer) + { + CV_DbgAssert(width == 0 || result / width == height); // make sure the result fits in the return value + } return result; }