fix #3110 (false positve: style) Boolean result is used in bitwise operation. Clarify expression with parentheses)

This commit is contained in:
Robert Reif 2011-09-12 07:32:55 -04:00
parent 3f517b5f23
commit 735ff11469
1 changed files with 2 additions and 1 deletions

View File

@ -195,7 +195,8 @@ void CheckOther::clarifyCondition()
if (Token::Match(tok2, "[&|^]"))
{
// don't write false positives when templates are used
if (Token::Match(tok, "<|>") && Token::Match(tok2, "& ,|>"))
if (Token::Match(tok, "<|>") && (Token::Match(tok2, "& ,|>") ||
Token::Match(tok2->previous(), "const &")))
continue;
clarifyConditionError(tok,false,true);