aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2025-01-29 10:02:28 -0500
committerPatrick Palka <ppalka@redhat.com>2025-01-29 10:02:28 -0500
commit09d1cbee10b8c51aed48f047f30717f622d6f811 (patch)
treed13b64df825d3983bea8fca12081991cc43980ab /gcc/expr.cc
parentdc6b949c553a3be1ce4d6671fb8a9de213ede114 (diff)
downloadgcc-09d1cbee10b8c51aed48f047f30717f622d6f811.zip
gcc-09d1cbee10b8c51aed48f047f30717f622d6f811.tar.gz
gcc-09d1cbee10b8c51aed48f047f30717f622d6f811.tar.bz2
libstdc++: Fix views::transform(move_only_fn{}) forwarding [PR118413]
The range adaptor perfect forwarding simplification mechanism is currently only enabled for trivially copyable bound arguments, to prevent undesirable copies of complex objects. But "trivially copyable" is the wrong property to check for here, since a move-only type with a trivial move constructor is considered trivially copyable, and after P2492R2 we can't assume copy constructibility of the bound arguments. This patch makes the mechanism more specifically check for trivial copy constructibility instead so that it's properly disabled for move-only bound arguments. PR libstdc++/118413 libstdc++-v3/ChangeLog: * include/std/ranges (views::__adaptor::_Partial): Adjust constraints on the "simple" partial specializations to require is_trivially_copy_constructible_v instead of is_trivially_copyable_v. * testsuite/std/ranges/adaptors/adjacent_transform/1.cc (test04): Extend P2494R2 test. * testsuite/std/ranges/adaptors/transform.cc (test09): Likewise. Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions