Regression test for 9106: False positive duplicateCondition for struct member (#2434)

This commit is contained in:
Paul Fultz II 2019-12-08 23:51:58 -06:00 committed by Daniel Marjamäki
parent 3d3e6f384c
commit 4aa6385a97
1 changed files with 8 additions and 0 deletions

View File

@ -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() {