http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57619
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2013-06-14 Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jesse Good from comment #0) > The following code is invoking the std::pair move constructor: Complete testcase: #include <unordered_map> #include <string> #include <cassert> int main () { std::unordered_multimap<std::string, std::string> mymultimap; std::pair<std::string, std::string> mypair{std::string("key"), std::string("value")}; mymultimap.insert(mypair); // std::pair move constructor invoked here assert( mypair.first.length() && mypair.second.length() ); } > As far as I can tell, overload resolution is choosing `insert(_Pair&& __x)` > over `insert(const value_type& __x)`. Since this is an lvalue, the latter > should be chosen. Calling that overload is correct, the problem is that it uses std::move() not std::forward<_Pair>