Merge branch 'macox_fixes' into build_enhancement

This commit is contained in:
Marek Kotewicz 2014-12-11 12:39:39 +01:00
commit 8f53101f6f
2 changed files with 3 additions and 2 deletions

View File

@ -52,7 +52,7 @@ shared_ptr<Type const> Type::fromElementaryTypeName(Token::Value _typeToken)
else if (_typeToken == Token::ADDRESS) else if (_typeToken == Token::ADDRESS)
return make_shared<IntegerType const>(0, IntegerType::Modifier::ADDRESS); return make_shared<IntegerType const>(0, IntegerType::Modifier::ADDRESS);
else if (_typeToken == Token::BOOL) else if (_typeToken == Token::BOOL)
return shared_ptr<BoolType const>(); return make_shared<BoolType const>();
else else
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unable to convert elementary typename " + BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unable to convert elementary typename " +
std::string(Token::toString(_typeToken)) + " to type.")); std::string(Token::toString(_typeToken)) + " to type."));
@ -87,7 +87,7 @@ shared_ptr<Type const> Type::forLiteral(Literal const& _literal)
{ {
case Token::TRUE_LITERAL: case Token::TRUE_LITERAL:
case Token::FALSE_LITERAL: case Token::FALSE_LITERAL:
return shared_ptr<BoolType const>(); return make_shared<BoolType const>();
case Token::NUMBER: case Token::NUMBER:
return IntegerType::smallestTypeForLiteral(_literal.getValue()); return IntegerType::smallestTypeForLiteral(_literal.getValue());
case Token::STRING_LITERAL: case Token::STRING_LITERAL:

View File

@ -184,6 +184,7 @@ private:
class BoolType: public Type class BoolType: public Type
{ {
public: public:
explicit BoolType() {}
virtual Category getCategory() const { return Category::BOOL; } virtual Category getCategory() const { return Category::BOOL; }
virtual bool isExplicitlyConvertibleTo(Type const& _convertTo) const override; virtual bool isExplicitlyConvertibleTo(Type const& _convertTo) const override;
virtual bool acceptsBinaryOperator(Token::Value _operator) const override virtual bool acceptsBinaryOperator(Token::Value _operator) const override