diff options
author | Pavel Labath <labath@google.com> | 2016-08-25 08:22:14 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2016-08-25 08:22:14 +0000 |
commit | c1566308aa7596efad6d3ddc852eb3b443748309 (patch) | |
tree | 4f9c2028247f2c9f7ca3c7b19ab13c5b1e999a56 | |
parent | 958fce3192ac088dae3371bdedb43ffd6d4a5402 (diff) | |
download | bcm5719-llvm-c1566308aa7596efad6d3ddc852eb3b443748309.tar.gz bcm5719-llvm-c1566308aa7596efad6d3ddc852eb3b443748309.zip |
Fix warnings preventing copy elision.
Summary:
Moving a temporary object prevents copy elision, which is exactly
what clang points out by warning about this pattern.
The fix is simply removal of std::move applied to temporary objects.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D23825
Author: Taras Tsugrii <ttsugrii@fb.com>
llvm-svn: 279724
-rw-r--r-- | lldb/tools/debugserver/source/JSON.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lldb/tools/debugserver/source/JSON.cpp b/lldb/tools/debugserver/source/JSON.cpp index e7e0423e9e8..9d56d1914aa 100644 --- a/lldb/tools/debugserver/source/JSON.cpp +++ b/lldb/tools/debugserver/source/JSON.cpp @@ -372,7 +372,7 @@ JSONParser::GetToken (std::string &value) if (escaped_ch == -1) { error << "error: an error occurred getting a character from offset " <<start_index; - value = std::move(error.str()); + value = error.str(); return Token::Error; } @@ -390,7 +390,7 @@ JSONParser::GetToken (std::string &value) { error << "error: wide character support is needed for unicode character 0x" << std::setprecision(4) << std::hex << escaped_ch; error << " at offset " << start_index; - value = std::move(error.str()); + value = error.str(); return Token::Error; } } @@ -460,7 +460,7 @@ JSONParser::GetToken (std::string &value) if (got_decimal_point) { error << "error: extra decimal point found at offset " << start_index; - value = std::move(error.str()); + value = error.str(); return Token::Error; } else @@ -475,7 +475,7 @@ JSONParser::GetToken (std::string &value) if (exp_index != 0) { error << "error: extra exponent character found at offset " << start_index; - value = std::move(error.str()); + value = error.str(); return Token::Error; } else @@ -495,7 +495,7 @@ JSONParser::GetToken (std::string &value) else { error << "error: unexpected " << next_ch << " character at offset " << start_index; - value = std::move(error.str()); + value = error.str(); return Token::Error; } break; @@ -521,7 +521,7 @@ JSONParser::GetToken (std::string &value) else { error << "error: got exponent character but no exponent digits at offset in float value \"" << value.c_str() << "\""; - value = std::move(error.str()); + value = error.str(); return Token::Error; } } @@ -535,7 +535,7 @@ JSONParser::GetToken (std::string &value) else { error << "error: no digits after decimal point \"" << value.c_str() << "\""; - value = std::move(error.str()); + value = error.str(); return Token::Error; } } @@ -551,7 +551,7 @@ JSONParser::GetToken (std::string &value) else { error << "error: no digits negate sign \"" << value.c_str() << "\""; - value = std::move(error.str()); + value = error.str(); return Token::Error; } } @@ -559,7 +559,7 @@ JSONParser::GetToken (std::string &value) else { error << "error: invalid number found at offset " << start_index; - value = std::move(error.str()); + value = error.str(); return Token::Error; } } @@ -568,7 +568,7 @@ JSONParser::GetToken (std::string &value) break; } error << "error: failed to parse token at offset " << start_index << " (around character '" << ch << "')"; - value = std::move(error.str()); + value = error.str(); return Token::Error; } |