diff --git a/libsolidity/Types.cpp b/libsolidity/Types.cpp index d14311a26..6c971a742 100644 --- a/libsolidity/Types.cpp +++ b/libsolidity/Types.cpp @@ -52,7 +52,7 @@ shared_ptr Type::fromElementaryTypeName(Token::Value _typeToken) else if (_typeToken == Token::ADDRESS) return make_shared(0, IntegerType::Modifier::ADDRESS); else if (_typeToken == Token::BOOL) - return shared_ptr(); + return make_shared(); else BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unable to convert elementary typename " + std::string(Token::toString(_typeToken)) + " to type.")); @@ -87,7 +87,7 @@ shared_ptr Type::forLiteral(Literal const& _literal) { case Token::TRUE_LITERAL: case Token::FALSE_LITERAL: - return shared_ptr(); + return make_shared(); case Token::NUMBER: return IntegerType::smallestTypeForLiteral(_literal.getValue()); case Token::STRING_LITERAL: diff --git a/libsolidity/Types.h b/libsolidity/Types.h index 887a1ee16..718f347f8 100644 --- a/libsolidity/Types.h +++ b/libsolidity/Types.h @@ -184,6 +184,7 @@ private: class BoolType: public Type { public: + explicit BoolType() {} virtual Category getCategory() const { return Category::BOOL; } virtual bool isExplicitlyConvertibleTo(Type const& _convertTo) const override; virtual bool acceptsBinaryOperator(Token::Value _operator) const override