diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-12-04 21:50:22 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2025-05-06 17:19:26 +0100 |
commit | df1d436d17c8280bd835b045bd7babf5058a7154 (patch) | |
tree | 329add55a50d580e3d1b7d4b71a157c00b423bd3 /libjava/gnu/xml/pipeline | |
parent | a067cbcdcc5f599a2b7d607e89674533d23c652d (diff) | |
download | gcc-df1d436d17c8280bd835b045bd7babf5058a7154.zip gcc-df1d436d17c8280bd835b045bd7babf5058a7154.tar.gz gcc-df1d436d17c8280bd835b045bd7babf5058a7154.tar.bz2 |
libstdc++: Fix <numeric> parallel algos for move-only values [PR117905]
All of reduce, transform_reduce, exclusive_scan, and inclusive_scan,
transform_exclusive_scan, and transform_inclusive_scan have a
precondition that the type of init meets the Cpp17MoveConstructible
requirements. It isn't required to be copy constructible, so when
passing it to the next internal function it needs to be moved, not
copied. We also need to move when creating local variables on the stack,
and when returning as part of a pair.
libstdc++-v3/ChangeLog:
PR libstdc++/117905
* include/pstl/glue_numeric_impl.h (reduce, transform_reduce)
(transform_reduce, inclusive_scan, transform_exclusive_scan)
(transform_inclusive_scan): Use std::move for __init parameter.
* include/pstl/numeric_impl.h (__brick_transform_reduce)
(__pattern_transform_reduce, __brick_transform_scan)
(__pattern_transform_scan): Likewise.
* include/std/numeric (inclusive_scan, transform_exclusive_scan):
Use std::move to create local copy of the first element.
* testsuite/26_numerics/pstl/numeric_ops/108236.cc: Move test
using move-only type to ...
* testsuite/26_numerics/pstl/numeric_ops/move_only.cc: New test.
Diffstat (limited to 'libjava/gnu/xml/pipeline')
0 files changed, 0 insertions, 0 deletions