diff options
author | chriseth <chris@ethereum.org> | 2018-12-19 22:11:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-19 22:11:20 +0800 |
commit | c8f20e075f46ce35a9975f43676dbe1794d7ea29 (patch) | |
tree | 642c9567b2272cd4450a702f2a735d1243754543 /libsolidity/parsing | |
parent | 8875092073a30c94659f8a373658ca8286803054 (diff) | |
parent | 62fe57479e7d8949e4ed2e0efb31238d5d8d6d0a (diff) | |
download | dexon-solidity-c8f20e075f46ce35a9975f43676dbe1794d7ea29.tar dexon-solidity-c8f20e075f46ce35a9975f43676dbe1794d7ea29.tar.gz dexon-solidity-c8f20e075f46ce35a9975f43676dbe1794d7ea29.tar.bz2 dexon-solidity-c8f20e075f46ce35a9975f43676dbe1794d7ea29.tar.lz dexon-solidity-c8f20e075f46ce35a9975f43676dbe1794d7ea29.tar.xz dexon-solidity-c8f20e075f46ce35a9975f43676dbe1794d7ea29.tar.zst dexon-solidity-c8f20e075f46ce35a9975f43676dbe1794d7ea29.zip |
Merge pull request #5635 from ethereum/cpp-default-ctors
[RFC] C++ `=default` ctors/dtors and the use of non-static member initializer syntax.
Diffstat (limited to 'libsolidity/parsing')
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 4 | ||||
-rw-r--r-- | libsolidity/parsing/Parser.h | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index bcb28988..8a6bc343 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -46,9 +46,9 @@ class Parser::ASTNodeFactory { public: explicit ASTNodeFactory(Parser const& _parser): - m_parser(_parser), m_location(_parser.position(), -1, _parser.source()) {} + m_parser(_parser), m_location{_parser.position(), -1, _parser.source()} {} ASTNodeFactory(Parser const& _parser, ASTPointer<ASTNode> const& _childNode): - m_parser(_parser), m_location(_childNode->location()) {} + m_parser(_parser), m_location{_childNode->location()} {} void markEndPosition() { m_location.end = m_parser.endPosition(); } void setLocation(SourceLocation const& _location) { m_location = _location; } diff --git a/libsolidity/parsing/Parser.h b/libsolidity/parsing/Parser.h index bf02c626..b8d0e9a8 100644 --- a/libsolidity/parsing/Parser.h +++ b/libsolidity/parsing/Parser.h @@ -47,7 +47,10 @@ private: struct VarDeclParserOptions { + // This is actually not needed, but due to a defect in the C++ standard, we have to. + // https://stackoverflow.com/questions/17430377 VarDeclParserOptions() {} + bool allowVar = false; bool isStateVariable = false; bool allowIndexed = false; @@ -85,7 +88,7 @@ private: ASTPointer<EnumDefinition> parseEnumDefinition(); ASTPointer<EnumValue> parseEnumValue(); ASTPointer<VariableDeclaration> parseVariableDeclaration( - VarDeclParserOptions const& _options = VarDeclParserOptions(), + VarDeclParserOptions const& _options = {}, ASTPointer<TypeName> const& _lookAheadArrayType = ASTPointer<TypeName>() ); ASTPointer<ModifierDefinition> parseModifierDefinition(); @@ -99,7 +102,7 @@ private: ASTPointer<FunctionTypeName> parseFunctionType(); ASTPointer<Mapping> parseMapping(); ASTPointer<ParameterList> parseParameterList( - VarDeclParserOptions const& _options, + VarDeclParserOptions const& _options = {}, bool _allowEmpty = true ); ASTPointer<Block> parseBlock(ASTPointer<ASTString> const& _docString = {}); |