Fixed #3086 (false positive: Boolean result is used in bitwise operation.)
This commit is contained in:
parent
9a97fbe022
commit
55230baf78
@ -195,7 +195,7 @@ void CheckOther::clarifyCondition()
|
|||||||
if (Token::Match(tok2, "[&|^]"))
|
if (Token::Match(tok2, "[&|^]"))
|
||||||
{
|
{
|
||||||
// don't write false positives when templates are used
|
// don't write false positives when templates are used
|
||||||
if (Token::Match(tok, "<|>") && !code_is_c() && tok2->str() == "&")
|
if (Token::Match(tok, "<|>") && Token::Match(tok2, "& ,|>"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
clarifyConditionError(tok,false,true);
|
clarifyConditionError(tok,false,true);
|
||||||
|
@ -2828,6 +2828,9 @@ private:
|
|||||||
check("void f() { A<x &> a; }");
|
check("void f() { A<x &> a; }");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
check("class A<B&,C>;", "test.C");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
check("void f() {\n"
|
check("void f() {\n"
|
||||||
" if (result != (char *)&inline_result) { }\n"
|
" if (result != (char *)&inline_result) { }\n"
|
||||||
"}");
|
"}");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user