[SERVER-23727] pessimizing moves Created: 14/Apr/16  Updated: 26/Apr/16  Resolved: 18/Apr/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.3.5

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Misha Tyulenev
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-23758 Non CLang compliant use of std::move Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 13 (04/22/16)
Participants:

 Description   

src/mongo/s/client/shard_factory_impl.cpp:46:55: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
    return stdx::make_unique<Shard>(shardId, connStr, std::move(_targeterFactory.create(connStr)));
                                                      ^
src/mongo/s/client/shard_factory_impl.cpp:46:55: note: remove std::move call here
    return stdx::make_unique<Shard>(shardId, connStr, std::move(_targeterFactory.create(connStr)));
                                                      ^~~~~~~~~~                                ~
src/mongo/s/client/shard_factory_impl.cpp:52:54: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
    return std::make_shared<Shard>(shardId, connStr, std::move(_targeterFactory.create(connStr)));
                                                     ^
src/mongo/s/client/shard_factory_impl.cpp:52:54: note: remove std::move call here
    return std::make_shared<Shard>(shardId, connStr, std::move(_targeterFactory.create(connStr)));
                                                     ^~~~~~~~~~                                ~
Compiling build/opt/mongo/s/catalog/replset/catalog_manager_replica_set.os
2 errors generated.



 Comments   
Comment by Githook User [ 18/Apr/16 ]

Author:

{u'username': u'mikety', u'name': u'Misha Tyulenev', u'email': u'misha@mongodb.com'}

Message: SERVER-23727 pessimizing std::move
Branch: master
https://github.com/mongodb/mongo/commit/0ff4f3b6679945d12a870d51964a72f4a362d832

Comment by Eric Milkie [ 14/Apr/16 ]

More:

src/mongo/s/client/shard_factory_mock.cpp:50:54: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
    return std::make_shared<Shard>(shardId, connStr, std::move(_targeterFactory.create(connStr)));
                                                     ^
src/mongo/s/client/shard_factory_mock.cpp:50:54: note: remove std::move call here
    return std::make_shared<Shard>(shardId, connStr, std::move(_targeterFactory.create(connStr)));
                                                     ^~~~~~~~~~                                ~
1 warning generated.

Generated at Thu Feb 08 04:04:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.