From 4aa6385a972e7c7fb371ad3f95dcba5b2ca4e96d Mon Sep 17 00:00:00 2001 From: Paul Fultz II Date: Sun, 8 Dec 2019 23:51:58 -0600 Subject: [PATCH] Regression test for 9106: False positive duplicateCondition for struct member (#2434) --- test/testcondition.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/testcondition.cpp b/test/testcondition.cpp index f8c8c34c8..4c9df34bd 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -3481,6 +3481,14 @@ private: " if (y.empty()) return;\n" "}\n"); ASSERT_EQUALS("", errout.str()); + + // #9106 + check("struct A {int b;};\n" + "void f(A a, int c) {\n" + " if (a.b) a.b = c;\n" + " if (a.b) {}\n" + "}\n"); + ASSERT_EQUALS("", errout.str()); } void checkInvalidTestForOverflow() {