diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qvarlengtharray.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 6a99602153..0cd811825c 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -633,8 +633,8 @@ Q_OUTOFLINE_TEMPLATE typename QVarLengthArray<T, Prealloc>::iterator QVarLengthA qsizetype offset = qsizetype(before - ptr); if (n != 0) { + const T copy(t); // `t` could alias an element in [begin(), end()[ resize(s + n); - const T copy(t); if (!QTypeInfo<T>::isRelocatable) { T *b = ptr + offset; T *j = ptr + s; |