http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48038
--- Comment #18 from Chris Jefferson <chris at bubblescope dot net> 2011-03-09 13:34:51 UTC --- Just to update: I have checked other users of MOVE_ITERATOR (there are only two) and they appear fine, as they do not use a comparator. Attached is an initial patch. Very sorry if the formatting (particular tabs) are off, I am using a different texteditor to normal and am having trouble configuring correctly. This patch might look quite long but it is actually fairly minimal. Basically we introduce methods __move_merge_backward and __move_merge, which act similarly to merge but move values. We call the comparitor methods without any moving, so they behave themselves. __merge_backward was only ever used with arguments that move, so I have renamed it to __move_merge_backward for clarity and changed the places it is called. Also introduce __move_merge which is identical to std::merge, except it moves values into place rather than copies them. Then fix all places which call merge or __merge_backward with MOVE_ITERATORS to use the new methods. Finally, there is a little testcase. As a sanity check, I would like to make sure that other types (the other sorts being the obvious target) also work correctly. I can't imagine why they wouldn't, but I'm very suprised this broke!