Skip to content

Commit e992e9b

Browse files
Update testcondition.cpp
1 parent 1dfc99f commit e992e9b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/testcondition.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5174,6 +5174,15 @@ class TestCondition : public TestFixture {
51745174
TODO_ASSERT_EQUALS("",
51755175
"[test.cpp:11:14]: (style) Condition 'p->i==o' is always true [knownConditionTrueFalse]\n",
51765176
errout_str());
5177+
5178+
check("void f(int x) {\n" // #12320
5179+
" int a = 0, b = 0, c = 0;\n"
5180+
" a = x;\n"
5181+
" if (a) b = x;\n"
5182+
" if (b) c = x;\n"
5183+
" if (c) {}\n"
5184+
"}\n");
5185+
ASSERT_EQUALS("", errout_str());
51775186
}
51785187

51795188
void alwaysTrueInfer() {

0 commit comments

Comments
 (0)