Skip to content

Commit 9415b7d

Browse files
committed
[Support] Fix -Wpessimizing-move in Mustache.cpp (NFC)
/llvm-project/llvm/lib/Support/Mustache.cpp:299:27: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move] PrevToken.TokenBody = std::move(Unindented.str()); ^ /llvm-project/llvm/lib/Support/Mustache.cpp:299:27: note: remove std::move call here PrevToken.TokenBody = std::move(Unindented.str()); ^~~~~~~~~~ ~ 1 error generated.
1 parent 8f05f25 commit 9415b7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Support/Mustache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ void stripTokenBefore(SmallVectorImpl<Token> &Tokens, size_t Idx,
296296
StringRef Unindented = PrevTokenBody.rtrim(" \r\t\v");
297297
size_t Indentation = PrevTokenBody.size() - Unindented.size();
298298
if (CurrentType != Token::Type::Partial)
299-
PrevToken.TokenBody = std::move(Unindented.str());
299+
PrevToken.TokenBody = Unindented.str();
300300
CurrentToken.setIndentation(Indentation);
301301
}
302302

0 commit comments

Comments
 (0)