Fixed #2945 (False positive: Uninitialized variable reading from stream)
This commit is contained in:
parent
a6740200cf
commit
4e55fb604c
|
@ -477,7 +477,7 @@ private:
|
|||
bool assignment = false;
|
||||
for (const Token *tok2 = tok.next(); tok2 && tok2->str() != ";"; tok2 = tok2->next())
|
||||
{
|
||||
if (tok2->str() == "=")
|
||||
if (tok2->str() == "=" || tok2->str() == ">>")
|
||||
{
|
||||
assignment = true;
|
||||
break;
|
||||
|
|
|
@ -181,6 +181,12 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkUninitVar("static int foo() {\n"
|
||||
" int ret;\n"
|
||||
" return cin >> ret;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkUninitVar("void f()\n"
|
||||
"{\n"
|
||||
" int a;\n"
|
||||
|
|
Loading…
Reference in New Issue