@@ -515,7 +515,7 @@ void CheckCondition::duplicateCondition()
515
515
516
516
void CheckCondition::duplicateConditionError (const Token *tok1, const Token *tok2, ErrorPath errorPath)
517
517
{
518
- if (diag (tok1) & diag (tok2))
518
+ if (diag (tok1) && diag (tok2))
519
519
return ;
520
520
errorPath.emplace_back (tok1, " First condition" );
521
521
errorPath.emplace_back (tok2, " Second condition" );
@@ -581,7 +581,7 @@ void CheckCondition::overlappingElseIfConditionError(const Token *tok, nonneg in
581
581
582
582
void CheckCondition::oppositeElseIfConditionError (const Token *ifCond, const Token *elseIfCond, ErrorPath errorPath)
583
583
{
584
- if (diag (ifCond) & diag (elseIfCond))
584
+ if (diag (ifCond) && diag (elseIfCond))
585
585
return ;
586
586
std::ostringstream errmsg;
587
587
errmsg << " Expression is always true because 'else if' condition is opposite to previous condition at line "
@@ -857,7 +857,7 @@ static std::string innerSmtString(const Token * tok)
857
857
858
858
void CheckCondition::oppositeInnerConditionError (const Token *tok1, const Token* tok2, ErrorPath errorPath)
859
859
{
860
- if (diag (tok1) & diag (tok2))
860
+ if (diag (tok1) && diag (tok2))
861
861
return ;
862
862
const std::string s1 (tok1 ? tok1->expressionString () : " x" );
863
863
const std::string s2 (tok2 ? tok2->expressionString () : " !x" );
@@ -872,7 +872,7 @@ void CheckCondition::oppositeInnerConditionError(const Token *tok1, const Token*
872
872
873
873
void CheckCondition::identicalInnerConditionError (const Token *tok1, const Token* tok2, ErrorPath errorPath)
874
874
{
875
- if (diag (tok1) & diag (tok2))
875
+ if (diag (tok1) && diag (tok2))
876
876
return ;
877
877
const std::string s1 (tok1 ? tok1->expressionString () : " x" );
878
878
const std::string s2 (tok2 ? tok2->expressionString () : " x" );
@@ -887,7 +887,7 @@ void CheckCondition::identicalInnerConditionError(const Token *tok1, const Token
887
887
888
888
void CheckCondition::identicalConditionAfterEarlyExitError (const Token *cond1, const Token* cond2, ErrorPath errorPath)
889
889
{
890
- if (diag (cond1) & diag (cond2))
890
+ if (diag (cond1) && diag (cond2))
891
891
return ;
892
892
893
893
const bool isReturnValue = cond2 && Token::simpleMatch (cond2->astParent (), " return" );
0 commit comments