From 1f411498b6a9574e06be261a799f6fc807b681c6 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Thu, 5 Aug 2021 08:07:03 +0200 Subject: [PATCH] #8196: Added a regression test --- test/testcondition.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/testcondition.cpp b/test/testcondition.cpp index f458ad13b..c38341f96 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -2952,6 +2952,13 @@ private: void alwaysTrue() { + check("void f(const struct S *s) {\n" //#8196 + " int x1 = s->x;\n" + " int x2 = s->x;\n" + " if (x1 == 10 && x2 == 10) {}\n" // << + "}"); + ASSERT_EQUALS("[test.cpp:4] -> [test.cpp:4]: (style) Condition 'x2==10' is always true\n", errout.str()); + check("void f ()\n"// #8220 "{\n" " int a;\n"