isOppositeCond: Fixed FN
This commit is contained in:
parent
d091639080
commit
d6c94e3828
|
@ -286,7 +286,7 @@ static bool isOverlappingCond(const Token * const cond1, const Token * const con
|
|||
|
||||
const MathLib::bigint value1 = MathLib::toLongNumber(num1->str());
|
||||
const MathLib::bigint value2 = MathLib::toLongNumber(num2->str());
|
||||
return (value2 > 0 && (value1 & value2) == value2);
|
||||
return ((value1 & value2) > 0);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -457,6 +457,12 @@ private:
|
|||
" else if (x == 0) {}\n"
|
||||
"}",false);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void f(int x) {\n"
|
||||
" if (x & 15) {}\n"
|
||||
" else if (x == 40) {}\n"
|
||||
"}",false);
|
||||
ASSERT_EQUALS("[test.cpp:3]: (style) Expression is always false because 'else if' condition matches previous condition at line 2.\n", errout.str());
|
||||
}
|
||||
|
||||
void invalidMissingSemicolon() {
|
||||
|
|
Loading…
Reference in New Issue