Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.7.0
-
None
-
clang 4.0 Revision: 291411 from http://apt.llvm.org/
-
c5e687895dd2eba3106f697b6e92b84683402403
Description
calling QtConcurrent::mappedReduced with a noexcept pointer to static member function as map parameter fails with the following error
/home/eric/Qt/5.7/gcc_64/include/QtCore/qvector.h:73:31: error: cannot form a reference to 'void' [clang-diagnostic-error] QVector(int size, const T &t); ^ /home/eric/Qt/5.7/gcc_64/include/QtConcurrent/qtconcurrentreducekernel.h:82:16: note: in instantiation of template class 'QVector<void>' requested here QVector<T> vector; ^ /home/eric/Qt/5.7/gcc_64/include/QtCore/qmap.h:117:7: note: in instantiation of template class 'QtConcurrent::IntermediateResults<void>' requested here T value; ^ /home/eric/Qt/5.7/gcc_64/include/QtCore/qmap.h:250:19: note: in instantiation of template class 'QMapNode<int, QtConcurrent::IntermediateResults<void> >' requested here root()->destroySubTree(); ^ /home/eric/Qt/5.7/gcc_64/include/QtCore/qmap.h:341:46: note: in instantiation of member function 'QMapData<int, QtConcurrent::IntermediateResults<void> >::destroy' requested here inline ~QMap() { if (!d->ref.deref()) d->destroy(); } ^ /home/eric/Qt/5.7/gcc_64/include/QtConcurrent/qtconcurrentreducekernel.h:100:7: note: in instantiation of member function 'QMap<int, QtConcurrent::IntermediateResults<void> >::~QMap' requested here class ReduceKernel ^ /home/eric/Qt/5.7/gcc_64/include/QtConcurrent/qtconcurrentmapkernel.h:247:34: note: in instantiation of member function 'QtConcurrent::SequenceHolder2<QSet<Interface_Type>, QtConcurrent::MappedReducedKernel<int, QSet<Interface_Type>::const_iterator, QVector<Interface_Data> (*)(Interface_Type) noexcept, (lambda at /home/eric/jenkins/workspace/PhysioFlow/software/staticAnalysis/Clang-Tidy/Core/Master/Device_Manager/device_manager.cpp:305:102), QtConcurrent::ReduceKernel<(lambda at /home/eric/jenkins/workspace/PhysioFlow/software/staticAnalysis/Clang-Tidy/Core/Master/Device_Manager/device_manager.cpp:305:102), int, void> >, QVector<Interface_Data> (*)(Interface_Type) noexcept, (lambda at /home/eric/jenkins/workspace/PhysioFlow/software/staticAnalysis/Clang-Tidy/Core/Master/Device_Manager/device_manager.cpp:305:102)>::SequenceHolder2' requested here return startThreadEngine(new SequenceHolderType(sequence, mapFunctor, reduceFunctor, options)); ^ /home/eric/Qt/5.7/gcc_64/include/QtConcurrent/qtconcurrentmap.h:126:12: note: in instantiation of function template specialization 'QtConcurrent::startMappedReduced<void, int, QSet<Interface_Type>, QVector<Interface_Data> (*)(Interface_Type) noexcept, (lambda at /home/eric/jenkins/workspace/PhysioFlow/software/staticAnalysis/Clang-Tidy/Core/Master/Device_Manager/device_manager.cpp:305:102)>' requested here return startMappedReduced<typename QtPrivate::MapResultType<void, MapFunctor>::ResultType, ResultType> ^ /home/eric/jenkins/workspace/PhysioFlow/software/staticAnalysis/Clang-Tidy/Core/Master/Device_Manager/device_manager.cpp:305:49: note: in instantiation of function template specialization 'QtConcurrent::mappedReduced<int, QSet<Interface_Type>, QVector<Interface_Data> (*)(Interface_Type) noexcept, (lambda at /home/eric/jenkins/workspace/PhysioFlow/software/staticAnalysis/Clang-Tidy/Core/Master/Device_Manager/device_manager.cpp:305:102)>' requested here const auto interfacesFuture = QtConcurrent::mappedReduced<int>(interfaceTypes, &Interface::scan, [this](auto &res, const auto &interfaces) noexcept
noexcept lambdas do not have this problem.
It is linked to http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html There was same same problem on QObject::connect : https://bugreports.qt.io/browse/QTBUG-58054 which is solved by https://codereview.qt-project.org/181868
qtconcurrentfunctionwrappers.h probably misses noexcept specialization
Attachments
Issue Links
- relates to
-
QTBUG-59683 tst_qtconcurrentrun.cpp doesn't build with GCC 7.0 and C++1z
- Closed
For Gerrit Dashboard: QTBUG-58142 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
182466,8 | Adapt to the C++ SIC introduced by P0012: noexcept overloading | 5.8 | qt/qtbase | Status: MERGED | +2 | 0 |
185904,1 | Adapt to the C++ SIC introduced by P0012: noexcept overloading | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |
189166,11 | Adapt to the C++ SIC introduced by P0012: noexcept specialization | 5.9 | qt/qtbase | Status: MERGED | +2 | 0 |