Fix the last test case from ticket #613 (array members variables are not checked in constructor)

http://sourceforge.net/apps/trac/cppcheck/ticket/613
This commit is contained in:
Reijo Tomperi 2009-08-26 23:33:23 +03:00
parent ff9ed1d7aa
commit 929dbe92e4
2 changed files with 5 additions and 1 deletions

View File

@ -221,6 +221,10 @@ void CheckClass::initializeVarList(const Token *tok1, const Token *ftok, Var *va
if (Token::simpleMatch(ftok, "this .")) if (Token::simpleMatch(ftok, "this ."))
ftok = ftok->tokAt(2); ftok = ftok->tokAt(2);
// Skip "classname :: "
if (Token::Match(ftok, "%var% ::"))
ftok = ftok->tokAt(2);
// Clearing all variables.. // Clearing all variables..
if (Token::simpleMatch(ftok, "memset ( this ,")) if (Token::simpleMatch(ftok, "memset ( this ,"))
{ {

View File

@ -414,7 +414,7 @@ private:
" char name[255];\n" " char name[255];\n"
"};\n"); "};\n");
TODO_ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
checkUninitVar("class John\n" checkUninitVar("class John\n"
"{\n" "{\n"