Fixed #2306 (False positive: array of std::string is reported as uninitialized)
This commit is contained in:
parent
696550abd3
commit
c2335f845e
|
@ -435,6 +435,7 @@ private:
|
|||
|
||||
// Variable declaration for array..
|
||||
if (Token::Match(vartok, "%type% %var% [") &&
|
||||
vartok->isStandardType() &&
|
||||
Token::simpleMatch(vartok->tokAt(2)->link(), "] ;"))
|
||||
{
|
||||
vartok = vartok->next();
|
||||
|
|
|
@ -946,6 +946,13 @@ private:
|
|||
" int b = a[0];\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkUninitVar("void foo()\n"
|
||||
"{\n"
|
||||
" Fred a[2];\n"
|
||||
" Fred b = a[0];\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
// alloc..
|
||||
|
|
Loading…
Reference in New Issue