diff options
author | Marc Mutz <marc.mutz@qt.io> | 2021-11-26 13:00:37 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2021-11-28 15:28:46 +0000 |
commit | f42a45d5a9bbbe30958064b0f6777f6e80430f22 (patch) | |
tree | d5a47331720e60b565d880276de3c14efe72e88a | |
parent | 645fd7b64a53067c79c387dc72bf714d5a87ffcc (diff) | |
download | qtbase-f42a45d5a9bbbe30958064b0f6777f6e80430f22.tar.gz |
QVarLengthArray: fix insert() type/alias mismatch between decl and impl
The declaration of insert(it, n, t) used qsizetype for n, while the
definition used size_type. That works by chance, because the size_type
typedef comes only after the insert(it, n, t) declaration. It was
detected when size_type became a typedef in a base class of
QVarLengthArray in my local branch.
Just use the same type name in the implementation as in the
declaration.
In 5.15, the same issue exists (with s/qsizetype/int/).
Change-Id: I64235eeaeaed3d43f4c070ca536474fae94c1b5d
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit fd1a42490dc14e5cf4fbbd2682722305ce7a27ed)
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-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 24444e19cc..a4f03a1110 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -501,7 +501,7 @@ Q_OUTOFLINE_TEMPLATE typename QVarLengthArray<T, Prealloc>::iterator QVarLengthA } template <class T, int Prealloc> -Q_OUTOFLINE_TEMPLATE typename QVarLengthArray<T, Prealloc>::iterator QVarLengthArray<T, Prealloc>::insert(const_iterator before, size_type n, const T &t) +Q_OUTOFLINE_TEMPLATE typename QVarLengthArray<T, Prealloc>::iterator QVarLengthArray<T, Prealloc>::insert(const_iterator before, int n, const T &t) { Q_ASSERT_X(isValidIterator(before), "QVarLengthArray::insert", "The specified const_iterator argument 'before' is invalid"); |