Fix unsafe moves inside loops
authorJonathan Wakely <jwakely@redhat.com>
Thu, 19 Jan 2017 20:29:07 +0000 (20:29 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 19 Jan 2017 20:29:07 +0000 (20:29 +0000)
commit9ade9945a07c47abf2d1d5ad3a5de504e9f37b73
tree96ac5c66055ac8069ff89eb49b7208b430f59042
parentab014eb3ae304092718018b8ae6122636b4c0b10
Fix unsafe moves inside loops

PR libstdc++/67085
* include/bits/stl_heap.h (__is_heap): Use _GLIBCXX_MOVE.
(__make_heap, __sort_heap): Don't use _GLIBCXX_MOVE inside loops.
* testsuite/23_containers/priority_queue/67085.cc: Adjust expected
number of copies.
* testsuite/25_algorithms/make_heap/movable.cc: New test.

From-SVN: r244650
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_heap.h
libstdc++-v3/testsuite/23_containers/priority_queue/67085.cc
libstdc++-v3/testsuite/25_algorithms/make_heap/movable.cc [new file with mode: 0644]