diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-01-31 10:41:49 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2024-02-02 10:27:16 +0000 |
commit | 723a7c1ad29523b9ddff53c7b147bffea56fbb63 (patch) | |
tree | 8eb2dcf14cce493ae1e10d3193d578d930f5dd49 /gcc/go | |
parent | a8f335ccb61bf6105192a4197ef2d84900614dc1 (diff) | |
download | gcc-723a7c1ad29523b9ddff53c7b147bffea56fbb63.zip gcc-723a7c1ad29523b9ddff53c7b147bffea56fbb63.tar.gz gcc-723a7c1ad29523b9ddff53c7b147bffea56fbb63.tar.bz2 |
libstdc++: Avoid reusing moved-from iterators in PSTL tests [PR90276]
The reverse_invoker utility for PSTL tests uses forwarding references for
all parameters, but some of those parameters get forwarded to move
constructors which then leave the objects in a moved-from state. When
the parameters are forwarded a second time that results in making new
copies of moved-from iterators. For libstdc++ debug mode iterators, the
moved-from state is singular, which means copying them will abort at
runtime.
The fix is to make copies of iterator arguments instead of forwarding
them.
The callers of reverse_invoker::operator() also forward the iterators
multiple times, but that's OK because reverse_invoker accepts them by
forwarding reference but then breaks the chain of forwarding and copies
them as lvalues.
libstdc++-v3/ChangeLog:
PR libstdc++/90276
* testsuite/util/pstl/test_utils.h (reverse_invoker): Do not use
perfect forwarding for iterator arguments.
Diffstat (limited to 'gcc/go')
0 files changed, 0 insertions, 0 deletions