diff --git a/liblangutil/Token.h b/liblangutil/Token.h index c4907aeac..ef0c7f6af 100644 --- a/liblangutil/Token.h +++ b/liblangutil/Token.h @@ -300,7 +300,7 @@ namespace TokenTraits constexpr bool isBitOp(Token op) { return (Token::BitOr <= op && op <= Token::BitAnd) || op == Token::BitNot; } constexpr bool isBooleanOp(Token op) { return (Token::Or <= op && op <= Token::And) || op == Token::Not; } - constexpr bool isUnaryOp(Token op) { return (Token::Not <= op && op <= Token::Delete) || op == Token::Add || op == Token::Sub; } + constexpr bool isUnaryOp(Token op) { return (Token::Not <= op && op <= Token::Delete) || op == Token::Sub; } constexpr bool isCountOp(Token op) { return op == Token::Inc || op == Token::Dec; } constexpr bool isShiftOp(Token op) { return (Token::SHL <= op) && (op <= Token::SHR); } constexpr bool isVariableVisibilitySpecifier(Token op) { return op == Token::Public || op == Token::Private || op == Token::Internal; } diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index efbbc5741..f0d4ecda3 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -4035,9 +4035,7 @@ void TypeChecker::endVisit(UsingForDirective const& _usingFor) bool identicalFirstTwoParameters = (parameterCount < 2 || *parameterTypes.at(0) == *parameterTypes.at(1)); bool isUnaryOnlyOperator = (!TokenTraits::isBinaryOp(operator_.value()) && TokenTraits::isUnaryOp(operator_.value())); - bool isBinaryOnlyOperator = - (TokenTraits::isBinaryOp(operator_.value()) && !TokenTraits::isUnaryOp(operator_.value())) || - operator_.value() == Token::Add; + bool isBinaryOnlyOperator = (TokenTraits::isBinaryOp(operator_.value()) && !TokenTraits::isUnaryOp(operator_.value())); bool firstParameterMatchesUsingFor = parameterCount == 0 || *usingForType == *parameterTypes.front(); optional wrongParametersMessage;