[Bug libstdc++/52822] [C++11] stable_partition destroys sequence due to inappropriate self-move-assignment
jyasskin at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Apr 12 22:26:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52822
--- Comment #11 from Jeffrey Yasskin <jyasskin at gcc dot gnu.org> 2012-04-12 22:26:08 UTC ---
Author: jyasskin
Date: Thu Apr 12 22:26:02 2012
New Revision: 186396
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186396
Log:
Fix PR52822 by explicitly checking for object identity before
move-assigning. This is a simpler fix than was committed to 4.7 and
4.8.
2012-04-12 Jeffrey Yasskin <jyasskin@google.com>
PR libstdc++/52822
* include/bits/stl_algo.h (__stable_partition_adaptive): Avoid
move-assigning an object to itself by explicitly testing for
identity.
* testsuite/25_algorithms/stable_partition/pr52822.cc: Test
vectors, which have a destructive self-move-assignment.
* testsuite/25_algorithms/stable_partition/moveable.cc (test02):
Test with rvalstruct, which explicitly checks
self-move-assignment.
Added:
branches/gcc-4_6-branch/libstdc++-v3/testsuite/25_algorithms/stable_partition/pr52822.cc
Modified:
branches/gcc-4_6-branch/libstdc++-v3/ChangeLog
branches/gcc-4_6-branch/libstdc++-v3/include/bits/stl_algo.h
branches/gcc-4_6-branch/libstdc++-v3/testsuite/25_algorithms/stable_partition/moveable.cc
More information about the Gcc-bugs
mailing list