From fe431320033d341c782297f38e5e1fb42c791ead Mon Sep 17 00:00:00 2001 From: Mathias Baumann Date: Mon, 11 May 2020 14:59:06 +0200 Subject: [PATCH] Fix clang v10 compilation errors --- libsolidity/analysis/GlobalContext.cpp | 2 +- libsolidity/analysis/ImmutableValidator.cpp | 2 +- libsolidity/codegen/ContractCompiler.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libsolidity/analysis/GlobalContext.cpp b/libsolidity/analysis/GlobalContext.cpp index a0764edba..d08f11979 100644 --- a/libsolidity/analysis/GlobalContext.cpp +++ b/libsolidity/analysis/GlobalContext.cpp @@ -123,7 +123,7 @@ vector GlobalContext::declarations() const { vector declarations; declarations.reserve(m_magicVariables.size()); - for (ASTPointer const& variable: m_magicVariables) + for (ASTPointer const& variable: m_magicVariables) declarations.push_back(variable.get()); return declarations; } diff --git a/libsolidity/analysis/ImmutableValidator.cpp b/libsolidity/analysis/ImmutableValidator.cpp index 0fad0a66d..e4fcfadcf 100644 --- a/libsolidity/analysis/ImmutableValidator.cpp +++ b/libsolidity/analysis/ImmutableValidator.cpp @@ -43,7 +43,7 @@ void ImmutableValidator::analyze() visitCallableIfNew(*contract->constructor()); for (ContractDefinition const* contract: linearizedContracts) - for (std::shared_ptr const inheritSpec: contract->baseContracts()) + for (std::shared_ptr const& inheritSpec: contract->baseContracts()) if (auto args = inheritSpec->arguments()) ASTNode::listAccept(*args, *this); diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index 319d7a7ad..678921824 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -587,13 +587,13 @@ bool ContractCompiler::visit(FunctionDefinition const& _function) if (!_function.isConstructor()) // adding 1 for return address. m_context.adjustStackOffset(parametersSize + 1); - for (ASTPointer const& variable: _function.parameters()) + for (ASTPointer const& variable: _function.parameters()) { m_context.addVariable(*variable, parametersSize); parametersSize -= variable->annotation().type->sizeOnStack(); } - for (ASTPointer const& variable: _function.returnParameters()) + for (ASTPointer const& variable: _function.returnParameters()) appendStackVariableInitialisation(*variable); if (_function.isConstructor()) @@ -650,7 +650,7 @@ bool ContractCompiler::visit(FunctionDefinition const& _function) if (stackLayout[i] != i) solAssert(false, "Invalid stack layout on cleanup."); - for (ASTPointer const& variable: _function.parameters() + _function.returnParameters()) + for (ASTPointer const& variable: _function.parameters() + _function.returnParameters()) m_context.removeVariable(*variable); m_context.adjustStackOffset(-(int)c_returnValuesSize);