mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #7551 from ethereum/060-cxx17-std-optional
Use `std::optional<>` rather than `boost::optional<>`
This commit is contained in:
@@ -122,7 +122,7 @@ bool ReferencesResolver::visit(ElementaryTypeName const& _typeName)
|
||||
if (!_typeName.annotation().type)
|
||||
{
|
||||
_typeName.annotation().type = TypeProvider::fromElementaryTypeName(_typeName.typeName());
|
||||
if (_typeName.stateMutability().is_initialized())
|
||||
if (_typeName.stateMutability().has_value())
|
||||
{
|
||||
// for non-address types this was already caught by the parser
|
||||
solAssert(_typeName.annotation().type->category() == Type::Category::Address, "");
|
||||
@@ -323,7 +323,7 @@ bool ReferencesResolver::visit(InlineAssembly const& _inlineAssembly)
|
||||
// Will be re-generated later with correct information
|
||||
// We use the latest EVM version because we will re-run it anyway.
|
||||
yul::AsmAnalysisInfo analysisInfo;
|
||||
boost::optional<Error::Type> errorTypeForLoose = Error::Type::SyntaxError;
|
||||
std::optional<Error::Type> errorTypeForLoose = Error::Type::SyntaxError;
|
||||
yul::AsmAnalyzer(
|
||||
analysisInfo,
|
||||
errorsIgnored,
|
||||
|
||||
@@ -241,7 +241,7 @@ void ViewPureChecker::endVisit(InlineAssembly const& _inlineAssembly)
|
||||
void ViewPureChecker::reportMutability(
|
||||
StateMutability _mutability,
|
||||
SourceLocation const& _location,
|
||||
boost::optional<SourceLocation> const& _nestedLocation
|
||||
std::optional<SourceLocation> const& _nestedLocation
|
||||
)
|
||||
{
|
||||
if (_mutability > m_bestMutabilityAndLocation.mutability)
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
namespace langutil
|
||||
{
|
||||
@@ -67,7 +68,7 @@ private:
|
||||
void reportMutability(
|
||||
StateMutability _mutability,
|
||||
langutil::SourceLocation const& _location,
|
||||
boost::optional<langutil::SourceLocation> const& _nestedLocation = {}
|
||||
std::optional<langutil::SourceLocation> const& _nestedLocation = {}
|
||||
);
|
||||
|
||||
std::vector<std::shared_ptr<ASTNode>> const& m_ast;
|
||||
|
||||
Reference in New Issue
Block a user