Skip to content

Commit 4aa6385

Browse files
pfultz2danmar
authored andcommitted
Regression test for 9106: False positive duplicateCondition for struct member (#2434)
1 parent 3d3e6f3 commit 4aa6385

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/testcondition.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3481,6 +3481,14 @@ class TestCondition : public TestFixture {
34813481
" if (y.empty()) return;\n"
34823482
"}\n");
34833483
ASSERT_EQUALS("", errout.str());
3484+
3485+
// #9106
3486+
check("struct A {int b;};\n"
3487+
"void f(A a, int c) {\n"
3488+
" if (a.b) a.b = c;\n"
3489+
" if (a.b) {}\n"
3490+
"}\n");
3491+
ASSERT_EQUALS("", errout.str());
34843492
}
34853493

34863494
void checkInvalidTestForOverflow() {

0 commit comments

Comments
 (0)