Disabled checkComparisonOfBoolWithBool since there are false positives. Ticket #2617
This commit is contained in:
parent
28df610a6e
commit
52be4a5925
|
@ -2323,6 +2323,11 @@ void CheckOther::comparisonOfTwoFuncsReturningBoolError(const Token *tok, const
|
|||
|
||||
void CheckOther::checkComparisonOfBoolWithBool()
|
||||
{
|
||||
// FIXME: This checking is "experimental" because of the false positives
|
||||
// when self checking lib/tokenize.cpp (#2617)
|
||||
if (!_settings->experimental)
|
||||
return;
|
||||
|
||||
if (!_settings->isEnabled("style"))
|
||||
return;
|
||||
|
||||
|
|
|
@ -4080,7 +4080,7 @@ private:
|
|||
}
|
||||
|
||||
void checkComparisonOfBoolWithBool() {
|
||||
check("void f(){\n"
|
||||
const char code[] = "void f(){\n"
|
||||
" int temp = 4;\n"
|
||||
" bool b = compare2(6);\n"
|
||||
" bool a = compare1(4);\n"
|
||||
|
@ -4101,8 +4101,11 @@ private:
|
|||
" }\n"
|
||||
" else\n"
|
||||
" return false;\n"
|
||||
"}\n");
|
||||
"}\n";
|
||||
check(code, "test.cpp", true);
|
||||
ASSERT_EQUALS("[test.cpp:5]: (style) Comparison of a variable having boolean value using relational (<, >, <= or >=) operator.\n", errout.str());
|
||||
check(code, "test.cpp");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void sizeofForNumericParameter() {
|
||||
|
|
Loading…
Reference in New Issue