diff options
author | Patrick Palka <ppalka@redhat.com> | 2023-03-09 13:25:44 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2023-03-09 13:25:44 -0500 |
commit | 3df9760d56662bdf38dd45f7398f003bbd64fdfe (patch) | |
tree | 6fafe86659845799b304eafc26df20091727eda3 /gcc/gimple-array-bounds.cc | |
parent | f366fdfeec0af6cda716de913c32e48f9b1e3a0e (diff) | |
download | gcc-3df9760d56662bdf38dd45f7398f003bbd64fdfe.zip gcc-3df9760d56662bdf38dd45f7398f003bbd64fdfe.tar.gz gcc-3df9760d56662bdf38dd45f7398f003bbd64fdfe.tar.bz2 |
libstdc++: extraneous begin in cartesian_product_view::end [PR107572]
ranges::begin() isn't guaranteed to be equality-preserving for non-forward
ranges, so in cartesian_product_view::end we need to avoid needlessly
calling begin() on the first range (which could be non-forward) in the
case where __empty_tail is false as per its specification.
Since we're already using a variadic lambda to compute __empty_tail, we
might as well use that same lambda to build up the tuple of iterators
instead of building it separately via e.g. std::apply or __tuple_transform.
PR libstdc++/107572
libstdc++-v3/ChangeLog:
* include/std/ranges (cartesian_product_view::end): When
building the tuple of iterators, avoid calling ranges::begin on
the first range if __empty_tail is false.
* testsuite/std/ranges/cartesian_product/1.cc (test07): New test.
Diffstat (limited to 'gcc/gimple-array-bounds.cc')
0 files changed, 0 insertions, 0 deletions