diff --git a/libyul/AsmParser.cpp b/libyul/AsmParser.cpp index 94dff259d..58babaaac 100644 --- a/libyul/AsmParser.cpp +++ b/libyul/AsmParser.cpp @@ -149,7 +149,7 @@ Statement Parser::parseStatement() case Token::LParen: { Expression expr = parseCall(std::move(elementary)); - return ExpressionStatement{locationOf(expr), expr}; + return ExpressionStatement{locationOf(expr), move(expr)}; } case Token::Comma: case Token::AssemblyAssign: @@ -192,7 +192,7 @@ Statement Parser::parseStatement() assignment.value = make_unique(parseExpression()); assignment.location.end = locationOf(*assignment.value).end; - return Statement{std::move(assignment)}; + return Statement{move(assignment)}; } default: fatalParserError(6913_error, "Call or assignment expected."); @@ -201,13 +201,13 @@ Statement Parser::parseStatement() if (holds_alternative(elementary)) { - Identifier& identifier = std::get(elementary); + Identifier identifier = std::get(move(elementary)); return ExpressionStatement{identifier.location, { move(identifier) }}; } else if (holds_alternative(elementary)) { - Expression expr = std::get(elementary); - return ExpressionStatement{locationOf(expr), expr}; + Literal literal = std::get(move(elementary)); + return ExpressionStatement{literal.location, { move(literal) }}; } else { @@ -411,7 +411,7 @@ FunctionDefinition Parser::parseFunctionDefinition() return funDef; } -Expression Parser::parseCall(Parser::ElementaryOperation&& _initialOp) +FunctionCall Parser::parseCall(Parser::ElementaryOperation&& _initialOp) { RecursionGuard recursionGuard(*this); diff --git a/libyul/AsmParser.h b/libyul/AsmParser.h index 2720e9760..2dcbcd191 100644 --- a/libyul/AsmParser.h +++ b/libyul/AsmParser.h @@ -87,7 +87,7 @@ protected: ElementaryOperation parseLiteralOrIdentifier(); VariableDeclaration parseVariableDeclaration(); FunctionDefinition parseFunctionDefinition(); - Expression parseCall(ElementaryOperation&& _initialOp); + FunctionCall parseCall(ElementaryOperation&& _initialOp); TypedName parseTypedName(); YulString expectAsmIdentifier();