Details
-
Bug
-
Resolution: Won't Do
-
P4: Low
-
6.2.6, 6.4.2, 6.5.0 Beta2
-
None
Description
See comments on QTBUG-111043 for an analysis.
TL;DR:
- Entry uses an ex-std::aligned_storage_t to store either a Node or a uchar
- so it should be a union, and then std::launder()'ing wouldn't be necessary on each node access
- making it a union will = delete its dtor if Node (~ pair<Key,Value>) is not std::is_trivially_destructible
- Entry doesn't know whether it contains a Node or not (that info is in Span::offsets), so we can't add a user-defined ~Entry()
- the existing code uses new[] and delete[] to (de)allocate Span::entries, so we need Entry to be std::destructible
- we cannot use malloc() and free() instead because old code will continue to use new[] and delete[], and mixing the two is UB
In order to avoid forgetting this come Qt 7, we should pre-program for QT_BOOTSTRAP || QT_VERSION_CHECK(7, 0, 0).
Attachments
Issue Links
- resulted from
-
QTBUG-111043 QHash is missing std::launder()
-
- Closed
-