Issue 8634: false negative: (style) Condition '...' is always true (#2075)

This commit is contained in:
Paul Fultz II 2019-08-12 04:04:01 -05:00 committed by amai2012
parent 2e9e3ed2f1
commit aadc404958
1 changed files with 9 additions and 0 deletions

View File

@ -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() {