Even less moving from unique_ptr
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 4 Nov 2015 14:38:59 +0000 (15:38 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Wed, 4 Nov 2015 14:40:06 +0000 (15:40 +0100)
clang-3.7 warns that these std::move calls prevent the copy-elision
optimization that is permitted for returns of named values. Now that
these pointers are always std::unique_ptr, we have no need of the
std::move anyway.

I missed these in an earlier patch, through not building the test
binaries when I checked clang-3.7.

Change-Id: I7b7518564a02c98117c7c7e92dcc7f8d12b7a245

src/testutils/refdata-impl.h
src/testutils/refdata-xml.cpp
src/testutils/refdata.cpp

index 1c87d5dfbb15f767eac612cd55bc8fb79f5ccd17..4d80baeee37727bd76db95255b0011e7140127ca 100644 (file)
@@ -138,7 +138,7 @@ class ReferenceDataEntry
             setCorrespondingOutputEntry(entry.get());
             entry->setValue(value());
             entry->isTextBlock_ = isTextBlock_;
-            return move(entry);
+            return entry;
         }
 
         void setValue(const std::string &value)
index c009dc5e93a07e523203976a1d26e7d884db7f3e..5ca7e658d109f99f0cc2cad75d28b118773a5534 100644 (file)
@@ -180,7 +180,7 @@ ReferenceDataEntry::EntryPointer createEntry(xmlNodePtr element)
     ReferenceDataEntry::EntryPointer entry(
             new ReferenceDataEntry(fromXmlString(element->name),
                                    id.toString().c_str()));
-    return move(entry);
+    return entry;
 }
 
 void readChildEntries(xmlNodePtr parentElement, ReferenceDataEntry *entry)
@@ -241,7 +241,7 @@ readReferenceDataFile(const std::string &path)
 
     ReferenceDataEntry::EntryPointer rootEntry(ReferenceDataEntry::createRoot());
     readEntry(rootNode, rootEntry.get());
-    return move(rootEntry);
+    return rootEntry;
 }
 //! \endcond
 
index 04c082fc2aba992da82f86a7a95c74962bd8d546..53a84fa8482c509d7131aaab7b5714664dbd368b 100644 (file)
@@ -344,7 +344,7 @@ class TestReferenceChecker::Impl
         {
             ReferenceDataEntry::EntryPointer entry(new ReferenceDataEntry(type, id));
             checker.fillEntry(entry.get());
-            return move(entry);
+            return entry;
         }
         //! Checks an entry for correct type and using \p checker.
         ::testing::AssertionResult