Skip to content

Commit 9e3ceac

Browse files
compnerdjrose-apple
authored andcommitted
swift-reflection-dump: fix -Wpessimizing-move (#2240)
warning: moving a temporary object prevents copy elision [-Wpessimizing-move] auto Expected = std::move(llvm::object::createBinary(binaryFileName) ^ note: remove std::move call here auto Expected = std::move(llvm::object::createBinary(binaryFilename) ^~~~~~~~~
1 parent 1ac5005 commit 9e3ceac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/swift-reflection-dump/swift-reflection-dump.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static int doDumpReflectionSections(std::string binaryFilename,
9898
OwningBinary<Binary> binaryOwner;
9999
std::unique_ptr<llvm::object::ObjectFile> objectOwner;
100100

101-
auto Expected = std::move(llvm::object::createBinary(binaryFilename));
101+
auto Expected = llvm::object::createBinary(binaryFilename);
102102
if (!Expected) {
103103
std::cerr << "Could not create binary for " << binaryFilename;
104104
return EXIT_FAILURE;

0 commit comments

Comments
 (0)