Fixed by #675 (false positive: when operator is overloaded)
This commit is contained in:
parent
55fc473a00
commit
c5368581d9
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue