Merge pull request #8890 from ethereum/fixclangv10

Fix clang v10 compilation errors
This commit is contained in:
chriseth 2020-05-11 15:39:09 +02:00 committed by GitHub
commit e2f7e8a3a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -125,7 +125,7 @@ vector<Declaration const*> GlobalContext::declarations() const
{
vector<Declaration const*> declarations;
declarations.reserve(m_magicVariables.size());
for (ASTPointer<Declaration const> const& variable: m_magicVariables)
for (ASTPointer<MagicVariableDeclaration const> const& variable: m_magicVariables)
declarations.push_back(variable.get());
return declarations;
}

View File

@ -43,7 +43,7 @@ void ImmutableValidator::analyze()
visitCallableIfNew(*contract->constructor());
for (ContractDefinition const* contract: linearizedContracts)
for (std::shared_ptr<InheritanceSpecifier> const inheritSpec: contract->baseContracts())
for (std::shared_ptr<InheritanceSpecifier> const& inheritSpec: contract->baseContracts())
if (auto args = inheritSpec->arguments())
ASTNode::listAccept(*args, *this);

View File

@ -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<VariableDeclaration const> const& variable: _function.parameters())
for (ASTPointer<VariableDeclaration> const& variable: _function.parameters())
{
m_context.addVariable(*variable, parametersSize);
parametersSize -= variable->annotation().type->sizeOnStack();
}
for (ASTPointer<VariableDeclaration const> const& variable: _function.returnParameters())
for (ASTPointer<VariableDeclaration> 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<VariableDeclaration const> const& variable: _function.parameters() + _function.returnParameters())
for (ASTPointer<VariableDeclaration> const& variable: _function.parameters() + _function.returnParameters())
m_context.removeVariable(*variable);
m_context.adjustStackOffset(-(int)c_returnValuesSize);