Fix FP bitwiseOnBoolean (#4280)
This commit is contained in:
parent
2c7d98626a
commit
2543dc97d2
|
@ -111,7 +111,7 @@ void CheckBool::checkBitwiseOnBoolean()
|
|||
const bool isBoolOp2 = astIsBool(tok->astOperand2());
|
||||
if (!(isBoolOp1 || isBoolOp2))
|
||||
continue;
|
||||
if (isCompound && !isBoolOp1)
|
||||
if (isCompound && (!isBoolOp1 || isBoolOp2))
|
||||
continue;
|
||||
if (tok->str() == "|" && !isConvertedToBool(tok) && !(isBoolOp1 && isBoolOp2))
|
||||
continue;
|
||||
|
|
|
@ -949,6 +949,12 @@ private:
|
|||
" if (b || c) {}\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("bool f(bool b, int i) {\n"
|
||||
" b &= (i == 5);\n"
|
||||
" return b;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void incrementBoolean() {
|
||||
|
|
Loading…
Reference in New Issue