Fixed ¤4596 (False positive, Variable 'value' is not assigned a value (x = x >> value))

This commit is contained in:
Daniel Marjamäki 2013-08-27 15:57:38 +02:00
parent 65d99feddf
commit 5d7ebadf25
1 changed files with 15 additions and 0 deletions

View File

@ -1640,6 +1640,21 @@ private:
" if (c >>= x) {}\n"
"}");
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