Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
None
-
6.0.0 Beta1
-
None
Description
In qtconcurrentstoredfunctioncall.h there's
static constexpr decltype (auto) invokePointer() { return &std::invoke<std::decay_t<Function>, QPromise<PromiseType> &, std::decay_t<Args>...>; }
This is undefined behavior https://eel.is/c++draft/library#namespace.std-6
Let F denote a standard library function ([global.functions]), a standard library static member function, or an instantiation of a standard library function template.
Unless F is designated an addressable function, the behavior of a C++ program is unspecified (possibly ill-formed) if it explicitly or implicitly attempts to form a pointer to F.
And doesn't build on Windows under /permissive-
https://testresults.qt.io/coin/integration/qt/qtbase/tasks/web_qt_qtbase_1603171941403
C:\Users\qt\work\install\include\QtConcurrent/qtconcurrentstoredfunctioncall.h(92): error C3556: 'invoke': incorrect argument to 'decltype' 16443: T=double, Function=std::reference_wrapper<void (__cdecl MyObject::* const )(QPromise<double> &) const> ] C:\Users\qt\work\install\include\QtConcurrent/qtconcurrentstoredfunctioncall.h(177): note: while compiling class template member function 'void QtConcurrent::StoredFunctionCallWithPromise<Function,PromiseType,_Ty>::runFunctor(void)' with [ Function=void (__cdecl MyObject::* )(QPromise<double> &) const, PromiseType=PromiseType, _Ty=const MyObject * ] C:\Users\qt\work\install\include\QtConcurrent/qtconcurrentstoredfunctioncall.h(92): error C3169: 'decltype(auto)': cannot deduce type for 'auto' from 'overloaded-function' 16444: Function=std::reference_wrapper<void (__cdecl MyObject::* const )(QPromise<double> &) const> ] C:\Users\qt\work\install\include\QtConcurrent/qtconcurrentstoredfunctioncall.h(177): note: while compiling class template member function 'void QtConcurrent::StoredFunctionCallWithPromise<Function,PromiseType,_Ty>::runFunctor(void)' with [ Function=void (__cdecl MyObject::* )(QPromise<double> &) const, PromiseType=PromiseType, _Ty=const MyObject * ]
Attachments
For Gerrit Dashboard: QTBUG-87719 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
318892,5 | Compile fix on Windows | dev | qt/qtbase | Status: MERGED | +2 | 0 |
319129,9 | Don't use pointers or references to functions from std library | dev | qt/qtbase | Status: MERGED | +2 | 0 |