Improved checking of const functions in checkIncorrectLogicOperator