From a16f6942546b2f6bc47d8d25e20ca703d878f692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 8 Dec 2018 08:25:20 +0100 Subject: [PATCH] Revert "Fix issue 8884: Regression: False positive: Variable 'f' is reassigned a value before the old one has been used (#1513)" This reverts commit 6953dddfa6645ccbcc05f9879f53af955397ddd4. --- lib/checkother.cpp | 3 --- test/testother.cpp | 8 -------- 2 files changed, 11 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 2ecba108f..764bbb447 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -490,9 +490,6 @@ void CheckOther::checkRedundantAssignment() if (!nextAssign) continue; - - if (nextAssign == tok) - continue; // there is redundant assignment. Is there a case between the assignments? bool hasCase = false; diff --git a/test/testother.cpp b/test/testother.cpp index 566e8f504..f6dfcb898 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -5968,14 +5968,6 @@ private: " 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()); - - // issue #8884 - check("template \n" - "auto foo(F f, Ts... xs) {\n" - " auto x = f(xs...);\n" - " return x;\n" - "}\n"); - ASSERT_EQUALS("", errout.str()); } void redundantVarAssignment_struct() {