Fixed by #675 (false positive: when operator is overloaded)

This commit is contained in:
Daniel Marjamäki 2009-09-16 20:07:03 +02:00
parent 55fc473a00
commit c5368581d9
2 changed files with 11 additions and 1 deletions

View File

@ -130,7 +130,7 @@ CheckClass::Var *CheckClass::getVarList(const Token *tok1, bool withClasses)
varname = next->strAt(3);
}
else if (Token::Match(next, "%type% %var% ["))
else if (Token::Match(next, "%type% %var% [") && next->next()->str() != "operator")
{
varname = next->strAt(1);
}

View File

@ -431,6 +431,16 @@ private:
"};\n");
ASSERT_EQUALS("", errout.str());
checkUninitVar("class John\n"
"{\n"
"public:\n"
" John() { }\n"
"\n"
" double operator[](const unsigned long i);\n"
"};\n");
ASSERT_EQUALS("", errout.str());
}
void uninitMissingFuncDef()