diff --git a/src/corelib/tools/qoffsetstringarray_p.h b/src/corelib/tools/qoffsetstringarray_p.h index 678e4102501..72df8f17375 100644 --- a/src/corelib/tools/qoffsetstringarray_p.h +++ b/src/corelib/tools/qoffsetstringarray_p.h @@ -65,9 +65,11 @@ struct OffsetSequenceHelper : OffsetSequenceHelper { }; template struct OffsetSequenceHelper<1, Last, I, S, Idx...> : IndexesList { + // the unary + before std::numeric_limits below is required. Otherwise we get on g++-10.2: + // error: comparison is always false due to limited range of data type [-Werror=type-limits] static const constexpr auto Length = Last + I; using Type = typename std::conditional< - Last <= std::numeric_limits::max(), + Last <= +std::numeric_limits::max(), quint8, typename std::conditional< Last <= std::numeric_limits::max(),