Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.4.1, 6.5.0 Beta1
-
None
-
-
5
-
7c5ff43ea (dev), 26b227e12 (dev), 938712a99 (6.4), 5e3940dbd (6.4), 934764a7b (6.5), 54a82ed48 (6.5), 800ebd84f (dev), 89672efd5 (6.5), 17c6ee5a2 (6.4)
-
Foundation Sprint 72, Foundation Sprint 73
Description
Starting from Qt 6.4.0, using
QVarLengthArray<std::vector<std::unique_ptr<int>>>
we hit an static assert in stl_uninitialized.h when using resize().
/usr/include/c++/12.2.0/bits/stl_construct.h:115:28: error: no matching function for call to ‘construct_at(std::unique_ptr<AutoPanGroupState, std::default_delete<AutoPanGroupState> >*&, const std::unique_ptr<AutoPanGroupState, std::default_delete<AutoPanGroupState> >&)’
115 | std::construct_at(_p, std::forward<_Args>(_args)...);
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
This is a regression since https://github.com/qt/qtbase/commit/a00a1d8806cfbf17e04b88d1b4ff4a9cf5b6294a#diff-3f4287973382b16af82c02e80740e5efbb0e5753771a19d6309eb2f7f6f6cd6d
Because std::is_copy_constructible_v<T> is true in our case
see also https://godbolt.org/z/948xd73xT
I think that can be solved by moving the value constructing version of
reallocate_impl() into a new function and not use a nullptr to destinguish the cases.
The original Bug has been reported here: