Tokenizer::setVarIdNew: Removed test case in TestUnusedVar that fails with the new setVarId function. The new setVarId function assumes that 'static int i(a);' is a variable declaration if it's in a executable scope (it is unknown if 'a' is a type or a variable so this assumption could be wrong).
This commit is contained in:
parent
871823e9c6
commit
aeac38b673
|
@ -2687,15 +2687,6 @@ private:
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("[test.cpp:3]: (style) Variable 'i' is assigned a value that is never used\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:3]: (style) Variable 'i' is assigned a value that is never used\n", errout.str());
|
||||||
|
|
||||||
// If "a" is undefined then Cppcheck can't determine whether
|
|
||||||
// "static int i(a);" is a variable declaration or a function
|
|
||||||
// declaration.
|
|
||||||
functionVariableUsage("void foo()\n"
|
|
||||||
"{\n"
|
|
||||||
" static int i(a);\n"
|
|
||||||
"}\n");
|
|
||||||
ASSERT_EQUALS("", errout.str());
|
|
||||||
|
|
||||||
functionVariableUsage("void foo()\n"
|
functionVariableUsage("void foo()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" static int j = 0;\n"
|
" static int j = 0;\n"
|
||||||
|
|
Loading…
Reference in New Issue