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:
Daniel Marjamäki 2012-04-22 10:42:55 +02:00
parent 871823e9c6
commit aeac38b673
1 changed files with 0 additions and 9 deletions

View File

@ -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"