diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-11-09 21:08:51 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2016-11-12 00:48:03 +0800 |
commit | eee629652e3ee851419805ad1cb54d168fa77763 (patch) | |
tree | 6c0343fc961c133d16491871577f3f6c43c0c24b /libsolidity/parsing | |
parent | 457daecba1f7e267cf7578b702945bb6532aa2af (diff) | |
download | dexon-solidity-eee629652e3ee851419805ad1cb54d168fa77763.tar.gz dexon-solidity-eee629652e3ee851419805ad1cb54d168fa77763.tar.zst dexon-solidity-eee629652e3ee851419805ad1cb54d168fa77763.zip |
parsing: ban empty enum definition.
Diffstat (limited to 'libsolidity/parsing')
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index 52b53619..df3ed7b2 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -406,6 +406,8 @@ ASTPointer<EnumDefinition> Parser::parseEnumDefinition() if (m_scanner->currentToken() != Token::Identifier) fatalParserError(string("Expected Identifier after ','")); } + if (members.size() == 0) + parserError({"enum with no members is not allowed."}); nodeFactory.markEndPosition(); expectToken(Token::RBrace); |