fix warning in GCC 9.1: redundant move in return statement

This commit is contained in:
Andrey Bronin 2019-05-14 17:44:28 +03:00
parent ea637f2097
commit 4eb37fe631
4 changed files with 9 additions and 9 deletions

View File

@ -437,7 +437,7 @@ boost::variant<OptimiserSettings, Json::Value> parseOptimizerSettings(Json::Valu
return *error; return *error;
} }
} }
return std::move(settings); return { std::move(settings) };
} }
} }
@ -663,7 +663,7 @@ boost::variant<StandardCompiler::InputsAndSettings, Json::Value> StandardCompile
ret.outputSelection = std::move(outputSelection); ret.outputSelection = std::move(outputSelection);
return std::move(ret); return { std::move(ret) };
} }
Json::Value StandardCompiler::compileSolidity(StandardCompiler::InputsAndSettings _inputsAndSettings) Json::Value StandardCompiler::compileSolidity(StandardCompiler::InputsAndSettings _inputsAndSettings)

View File

@ -63,7 +63,7 @@ wasm::Expression EWasmCodeTransform::generateMultiAssignment(
wasm::LocalAssignment assignment{move(_variableNames.front()), std::move(_firstValue)}; wasm::LocalAssignment assignment{move(_variableNames.front()), std::move(_firstValue)};
if (_variableNames.size() == 1) if (_variableNames.size() == 1)
return move(assignment); return { std::move(assignment) };
wasm::Block block; wasm::Block block;
block.statements.emplace_back(move(assignment)); block.statements.emplace_back(move(assignment));
@ -72,7 +72,7 @@ wasm::Expression EWasmCodeTransform::generateMultiAssignment(
move(_variableNames.at(i)), move(_variableNames.at(i)),
make_unique<wasm::Expression>(wasm::GlobalVariable{m_globalVariables.at(i - 1).variableName}) make_unique<wasm::Expression>(wasm::GlobalVariable{m_globalVariables.at(i - 1).variableName})
}); });
return move(block); return { std::move(block) };
} }
wasm::Expression EWasmCodeTransform::operator()(VariableDeclaration const& _varDecl) wasm::Expression EWasmCodeTransform::operator()(VariableDeclaration const& _varDecl)
@ -192,7 +192,7 @@ wasm::Expression EWasmCodeTransform::operator()(Switch const& _switch)
*currentBlock += visit(c.body.statements); *currentBlock += visit(c.body.statements);
} }
} }
return move(block); return { std::move(block) };
} }
wasm::Expression EWasmCodeTransform::operator()(FunctionDefinition const&) wasm::Expression EWasmCodeTransform::operator()(FunctionDefinition const&)
@ -224,7 +224,7 @@ wasm::Expression EWasmCodeTransform::operator()(ForLoop const& _for)
wasm::Block breakBlock{breakLabel, {}}; wasm::Block breakBlock{breakLabel, {}};
breakBlock.statements.emplace_back(move(loop)); breakBlock.statements.emplace_back(move(loop));
return move(breakBlock); return { std::move(breakBlock) };
} }
wasm::Expression EWasmCodeTransform::operator()(Break const&) wasm::Expression EWasmCodeTransform::operator()(Break const&)

View File

@ -38,7 +38,7 @@ void ForLoopInitRewriter::operator()(Block& _block)
vector<Statement> rewrite; vector<Statement> rewrite;
swap(rewrite, forLoop.pre.statements); swap(rewrite, forLoop.pre.statements);
rewrite.emplace_back(move(forLoop)); rewrite.emplace_back(move(forLoop));
return std::move(rewrite); return { std::move(rewrite) };
} }
else else
{ {

View File

@ -106,7 +106,7 @@ void SSATransform::operator()(Block& _block)
}); });
} }
boost::get<VariableDeclaration>(statements.front()).variables = std::move(newVariables); boost::get<VariableDeclaration>(statements.front()).variables = std::move(newVariables);
return std::move(statements); return { std::move(statements) };
} }
else if (_s.type() == typeid(Assignment)) else if (_s.type() == typeid(Assignment))
{ {
@ -133,7 +133,7 @@ void SSATransform::operator()(Block& _block)
}); });
} }
boost::get<VariableDeclaration>(statements.front()).variables = std::move(newVariables); boost::get<VariableDeclaration>(statements.front()).variables = std::move(newVariables);
return std::move(statements); return { std::move(statements) };
} }
else else
visit(_s); visit(_s);