Revert "Fixed #4165 (False positive:(error) Uninitialized variable: here)"

This reverts commit 96b1890797.
This commit is contained in:
Daniel Marjamäki 2012-09-26 16:15:35 +02:00
parent 96b1890797
commit 753942df0c
2 changed files with 1 additions and 7 deletions

View File

@ -1325,7 +1325,7 @@ bool CheckUninitVar::isVariableUsage(const Token *vartok, bool pointer) const
return false; return false;
} }
if (Token::Match(vartok->next(), "++|--|%op%") && !Token::simpleMatch(vartok->tokAt(-2), "( &")) if (Token::Match(vartok->next(), "++|--|%op%"))
return true; return true;
if (vartok->strAt(1) == "]") if (vartok->strAt(1) == "]")

View File

@ -2002,12 +2002,6 @@ private:
"}"); "}");
ASSERT_EQUALS("[test.cpp:3]: (error) Uninitialized variable: x\n", errout.str()); ASSERT_EQUALS("[test.cpp:3]: (error) Uninitialized variable: x\n", errout.str());
checkUninitVar2("void f() {\n" // #4165 - fp when & is used as address-of in condition
" int x;\n"
" if (&x < p) { }\n"
"}");
ASSERT_EQUALS("", errout.str());
// ?: // ?:
checkUninitVar2("int f(int *ptr) {\n" checkUninitVar2("int f(int *ptr) {\n"
" int a;\n" " int a;\n"