From 62fe57479e7d8949e4ed2e0efb31238d5d8d6d0a Mon Sep 17 00:00:00 2001 From: Christian Parpart Date: Wed, 12 Dec 2018 14:51:22 +0100 Subject: make use of C++ `= default` constructor declarations as well as more non-static member initialization syntax. --- libsolidity/parsing/Parser.cpp | 2 +- libsolidity/parsing/Parser.h | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'libsolidity/parsing') diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index 5b9c309a..8a6bc343 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -48,7 +48,7 @@ public: explicit ASTNodeFactory(Parser const& _parser): m_parser(_parser), m_location{_parser.position(), -1, _parser.source()} {} ASTNodeFactory(Parser const& _parser, ASTPointer 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 parseEnumDefinition(); ASTPointer parseEnumValue(); ASTPointer parseVariableDeclaration( - VarDeclParserOptions const& _options = VarDeclParserOptions(), + VarDeclParserOptions const& _options = {}, ASTPointer const& _lookAheadArrayType = ASTPointer() ); ASTPointer parseModifierDefinition(); @@ -99,7 +102,7 @@ private: ASTPointer parseFunctionType(); ASTPointer parseMapping(); ASTPointer parseParameterList( - VarDeclParserOptions const& _options, + VarDeclParserOptions const& _options = {}, bool _allowEmpty = true ); ASTPointer parseBlock(ASTPointer const& _docString = {}); -- cgit