Fixed #1214 (false positive: uninitialized variable 'bool fixed = std::ios_base::fixed;')

This commit is contained in:
Daniel Marjamäki 2010-01-03 08:03:28 +01:00
parent 38b480a4b5
commit 1032eb2449
2 changed files with 7 additions and 1 deletions

View File

@ -1568,7 +1568,7 @@ private:
if (Token::Match(tok2, "%var% ("))
break;
if (tok2->varId() &&
!Token::simpleMatch(tok2->previous(), "&") &&
!Token::Match(tok2->previous(), "&|::") &&
!Token::simpleMatch(tok2->next(), "="))
use(foundError, checks, tok2);
}

View File

@ -1034,6 +1034,12 @@ private:
"}\n");
ASSERT_EQUALS("", errout.str());
checkUninitVar("void foo()\n"
"{\n"
" int x = xyz::x;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
checkUninitVar("static int foo()\n"
"{\n"
" int ret;\n"