Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-54199

Stop warning on redundant moves

    • Fully Compatible
    • ALL
    • Dev Platform 2021-03-22

      By definition redundant moves are harmless, unlike pessimizing moves. Additionally the cases where implicit moves are allowed changes not just based on the standard revision, but also based on DRs, so it can change between compiler versions even at the same -std=c++XX level. The example given in the comment justifying the flag (https://github.com/mongodb/mongo/blob/8baad6fdb799b24bbc999089773698a10bfeaecc/SConstruct#L2842-L2844) is just such a case. It used to be required to have an explicit move, but on some compilers that have applied the DR, it isn't anymore. Given that it isn't harmful, and that there is actually a move happening (unlike the move-elision pessimization case), it seems reasonable to leave the std::move in place, and is at least unhelpful to warn about it.

      Acceptance criteria:

      Remove the flag

            Assignee:
            daniel.moody@mongodb.com Daniel Moody
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: