Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.1.2
-
None
-
-
8
-
642b9fce81b46e23b35b17e8284bd81bdba57fdd (qt/qtbase/dev) b91311c8bfa30ec02afb8027befff8943c8ff197 (qt/qtbase/6.2) 4d942551492378adaddca55cb1a48c11e7ec6a3a (qt/qtbase/6.1)
-
Qt6_Foundation_Sprint 40
Description
The issue is as simple as
class X { public: X(int) { } }; void f() { QFuture<X> x = QtConcurrent::run([]{ return X(0); }); }
It fails with a very long error message! In there we can find
error: use of deleted function ‘QtConcurrent::RunFunctionTask<X>::RunFunctionTask()" ... "error: no matching function for call to ‘X::X()"
Apparently, QtConcurrent::run wants to save the lambdas' return value in a member and later assign it, but if the value is not default constructible, that won't work!