fix: error: call of overloaded ‘list(int, <brace-enclosed initializer list>)’

Issue: https://github.com/ethereum/solidity/issues/574

Compilation of webthree-umbrella on Arch with gcc 6.1 results in the following
error:

/home/mwo/webthree-umbrella/solidity/libsolidity/analysis/NameAndTypeResolver.cpp:299:51: error: call of overloaded ‘list(int, <brace-enclosed initializer list>)’ is ambiguous
  list<list<ContractDefinition const*>> input(1, {});

This can be overcome by explicitly specifying initial value, for example:

  list<list<ContractDefinition const*>> input(1, list<ContractDefinition const*>{})
This commit is contained in:
moneroexample 2016-05-17 13:27:39 +08:00
parent 4b445b898e
commit 9d237fbfdc

View File

@ -296,7 +296,7 @@ void NameAndTypeResolver::linearizeBaseContracts(ContractDefinition& _contract)
{
// order in the lists is from derived to base
// list of lists to linearize, the last element is the list of direct bases
list<list<ContractDefinition const*>> input(1, {});
list<list<ContractDefinition const*>> input(1, list<ContractDefinition const*>{});
for (ASTPointer<InheritanceSpecifier> const& baseSpecifier: _contract.baseContracts())
{
UserDefinedTypeName const& baseName = baseSpecifier->name();