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

dbtest does not compile with clang 7

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.7
    • Affects Version/s: None
    • Component/s: Build
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Dev Tools 2018-12-31

      When building the dbtest binary with clang 7, the following error is emitted:

      Compiling build/cached/mongo/dbtests/insert_test.o
      src/mongo/dbtests/insert_test.cpp:79:12: error: local variable 'obj' will be copied despite being returned by name
            [-Werror,-Wreturn-std-move]
          return obj;
                 ^~~
      src/mongo/dbtests/insert_test.cpp:79:12: note: call 'std::move' explicitly to avoid copying
          return obj;
                 ^~~
                 std::move(obj)
      1 error generated.
      scons: *** [build/cached/mongo/dbtests/insert_test.o] Error 1
      scons: done building targets (errors occurred during build).
      

      The fix is to either change the function to return BSONArray, or to change it to return std::move(obj);. The former change is probably preferred for clarity.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: