qt5base-lts/tests/auto/concurrent
Sona Kurazyan bd1023a824 QtConcurrent: prevent conversion of ReduceOption to initial value
QtConcurrent map- and filter-reduce functions take an initial value,
which can be of any type that is convertable to the result type. The
side-effect of this is that the enum values passed as ReduceOptions can
be treated as an initial value (if they are convertable to the result
type) which will result into a wrong overload call. To avoid this, added
additional check to make sure that the initial value type doesn't match
with ReduceOption enum.

Note that this required including the qtconcurrentreducekernel.h header
in qtconcurrentfunctionwrappers.h (which contains compiler checks for
QtConcurrent) for accessing ReduceOption enum, so I had to get rid of
qtconcurrentfunctionwrappers.h include from qtconcurrentreducekernel.h
to avoid circular header includes. This, in turn, required moving the
QtPrivate::SequenceHolder helper type to qtconcurrentreducekernel.h,
which didn't belong to qtconcurrentfunctionwrappers.h anyway.

Pick-to: 6.3 6.2
Fixes: QTBUG-102999
Change-Id: Ieaa8ef2e4bd82ce2ada2e0af9a47b87b51d59e87
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-05-20 17:11:15 +02:00
..
qtconcurrentfilter QtConcurrent: prevent conversion of ReduceOption to initial value 2022-05-20 17:11:15 +02:00
qtconcurrentfiltermapgenerated Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qtconcurrentiteratekernel Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qtconcurrentmap QtConcurrent: prevent conversion of ReduceOption to initial value 2022-05-20 17:11:15 +02:00
qtconcurrentmedian Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qtconcurrentrun Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qtconcurrenttask Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qtconcurrentthreadengine Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
CMakeLists.txt Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
testhelper_functions.h Use SPDX license identifiers 2022-05-16 16:37:38 +02:00