Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.0, 6.1, 6.2
-
None
Description
This code regressed in Qt 6:
QVector<int> v; v.resize(4); v.erase(v.begin()); while (v.size() < v.capacity()) { v.push_back(0); }
The while loop never terminates; the vector is reallocated too early, when size() == capacity() - 1, and keeps getting reallocated like that.
Attachments
Issue Links
- relates to
-
QTBUG-93019 [REG 5.15-6.0] QList/QVector regressions
- Open
Gerrit Reviews
For Gerrit Dashboard: QTBUG-92941 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
350928,4 | Introduce side-aware capacity-like methods to QList | dev | qt/qtbase | Status: DEFERRED | 0 | 0 |
354792,2 | QList: more explicitly document capacity() shenanigans | dev | qt/qtbase | Status: MERGED | +2 | 0 |
355265,2 | QList: more explicitly document capacity() shenanigans | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 |