Fixed ¤4596 (False positive, Variable 'value' is not assigned a value (x = x >> value))
This commit is contained in:
parent
65d99feddf
commit
5d7ebadf25
|
@ -1640,6 +1640,21 @@ private:
|
||||||
" if (c >>= x) {}\n"
|
" if (c >>= x) {}\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
functionVariableUsage("void f() {\n"
|
||||||
|
" int x;\n"
|
||||||
|
" C c;\n"
|
||||||
|
" if (c >>= x) {}\n"
|
||||||
|
"}", "test.c");
|
||||||
|
TODO_ASSERT_EQUALS("[test.c:2]: (style) Variable 'x' is not assigned a value.\n",
|
||||||
|
"[test.c:2]: (style) Variable 'x' is not assigned a value.\n"
|
||||||
|
"[test.c:3]: (style) Variable 'c' is not assigned a value.\n", errout.str());
|
||||||
|
|
||||||
|
functionVariableUsage("void f(int c) {\n"
|
||||||
|
" int x;\n"
|
||||||
|
" if (c >> x) {}\n"
|
||||||
|
"}");
|
||||||
|
TODO_ASSERT_EQUALS("[test.c:2]: (style) Variable 'x' is not assigned a value.\n", "", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void localvar33() { // ticket #2345
|
void localvar33() { // ticket #2345
|
||||||
|
|
Loading…
Reference in New Issue