[SERVER-24108] Pessimizing move warning in chunktests.cpp Created: 09/May/16  Updated: 06/Jun/16  Resolved: 16/May/16

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

Type: Bug Priority: Major - P3
Reporter: Kamran K. Assignee: Kaloian Manassiev
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-24161 pessimizing move Closed
Related
is related to SERVER-24071 Introduce ChunkRange class Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 14 (05/13/16), Sharding 15 (06/03/16)
Participants:

 Description   

It looks like the warning was introduced via SERVER-24071.

src/mongo/s/chunk_manager.cpp:199:34: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
                _chunkRangeMap = std::move(_constructRanges(_chunkMap));
                                 ^
src/mongo/s/chunk_manager.cpp:199:34: note: remove std::move call here
                _chunkRangeMap = std::move(_constructRanges(_chunkMap));
                                 ^~~~~~~~~~                           ~
1 error generated.



 Comments   
Comment by Githook User [ 16/May/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-24108 Remove pessimizing move in chunktests.cpp
Branch: master
https://github.com/mongodb/mongo/commit/deb251d2830954309592e581ffa0d9f5319d61ce

Comment by Kamran K. [ 09/May/16 ]

There's another in dbtests:

src/mongo/dbtests/chunktests.cpp:68:26: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
        _chunkRangeMap = std::move(_constructRanges(_chunkMap));
                         ^
src/mongo/dbtests/chunktests.cpp:68:26: note: remove std::move call here
        _chunkRangeMap = std::move(_constructRanges(_chunkMap));
                         ^~~~~~~~~~                           ~
Compiling build/opt/mongo/dbtests/extensions_callback_real_test.o
1 error generated.

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