Revert "Fix issue 8884: Regression: False positive: Variable 'f' is reassigned a value before the old one has been used (#1513)"

This reverts commit 6953dddfa6.
This commit is contained in:
Daniel Marjamäki 2018-12-08 08:25:20 +01:00
parent 81e6d67d2c
commit a16f694254
2 changed files with 0 additions and 11 deletions

View File

@ -491,9 +491,6 @@ void CheckOther::checkRedundantAssignment()
if (!nextAssign) if (!nextAssign)
continue; continue;
if (nextAssign == tok)
continue;
// there is redundant assignment. Is there a case between the assignments? // there is redundant assignment. Is there a case between the assignments?
bool hasCase = false; bool hasCase = false;
for (const Token *tok2 = tok; tok2 != nextAssign; tok2 = tok2->next()) { for (const Token *tok2 = tok; tok2 != nextAssign; tok2 = tok2->next()) {

View File

@ -5968,14 +5968,6 @@ private:
" memptr = 0;\n" " memptr = 0;\n"
"}"); "}");
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:4]: (style) Variable 'memptr' is reassigned a value before the old one has been used.\n", errout.str()); ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:4]: (style) Variable 'memptr' is reassigned a value before the old one has been used.\n", errout.str());
// issue #8884
check("template <class F, class... Ts>\n"
"auto foo(F f, Ts... xs) {\n"
" auto x = f(xs...);\n"
" return x;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
} }
void redundantVarAssignment_struct() { void redundantVarAssignment_struct() {