Issue 8634: false negative: (style) Condition '...' is always true (#2075)
This commit is contained in:
parent
2e9e3ed2f1
commit
aadc404958
|
@ -3175,6 +3175,15 @@ private:
|
|||
" else if (x) {}\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void f(int *array, int size ) {\n"
|
||||
" for(int i = 0; i < size; ++i) {\n"
|
||||
" if(array == 0)\n"
|
||||
" continue;\n"
|
||||
" if(array){}\n"
|
||||
" }\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:5]: (style) Condition 'array' is always true\n", errout.str());
|
||||
}
|
||||
|
||||
void multiConditionAlwaysTrue() {
|
||||
|
|
Loading…
Reference in New Issue