diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 3668ebcfc9..18066a80ef 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -63,7 +63,10 @@ class QVarLengthArray static_assert(std::is_nothrow_destructible_v, "Types with throwing destructors are not supported in Qt containers."); public: - QVarLengthArray() : QVarLengthArray(0) {} + QVarLengthArray() noexcept + : a{Prealloc}, s{0}, ptr{reinterpret_cast(array)} + { + } inline explicit QVarLengthArray(qsizetype size);