[Lldb-commits] [lldb] e913a75 - Fix a warning about named return value not being moved-from.

David Blaikie via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 1 09:25:45 PST 2021


Author: David Blaikie
Date: 2021-03-01T09:25:26-08:00
New Revision: e913a754143f227b4aea5f695a2dcd2349101886

URL: https://github.com/llvm/llvm-project/commit/e913a754143f227b4aea5f695a2dcd2349101886
DIFF: https://github.com/llvm/llvm-project/commit/e913a754143f227b4aea5f695a2dcd2349101886.diff

LOG: Fix a warning about named return value not being moved-from.

The use of an rvalue reference here was using reference lifetime
extension needlessly - the code is simpler and more efficient without
it.

Added: 
    

Modified: 
    lldb/source/Interpreter/OptionValue.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Interpreter/OptionValue.cpp b/lldb/source/Interpreter/OptionValue.cpp
index 350afeb073c4..0846fa9278cb 100644
--- a/lldb/source/Interpreter/OptionValue.cpp
+++ b/lldb/source/Interpreter/OptionValue.cpp
@@ -569,7 +569,7 @@ bool OptionValue::DumpQualifiedName(Stream &strm) const {
 }
 
 OptionValueSP OptionValue::DeepCopy(const OptionValueSP &new_parent) const {
-  auto &&clone = Clone();
+  auto clone = Clone();
   clone->SetParent(new_parent);
   return clone;
 }


        


More information about the lldb-commits mailing list