Skip to content

Commit 59cf0ba

Browse files
committed
Add test for #12391
1 parent 76f1aac commit 59cf0ba

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/testcondition.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5678,6 +5678,15 @@ class TestCondition : public TestFixture {
56785678
"}\n");
56795679
ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:3]: (style) The if condition is the same as the previous if condition\n", errout_str());
56805680

5681+
check("struct S { int x; };\n" // #12391
5682+
"int f(const struct S* a, const struct S* b) {\n"
5683+
" const struct S* p = b;\n"
5684+
" if (a->x < p->x) p++;\n"
5685+
" if (a->x < p->x) p++;\n"
5686+
" return p->x;\n"
5687+
"}\n");
5688+
ASSERT_EQUALS("", errout_str());
5689+
56815690
// do not crash
56825691
check("void assign(const MMA& other) {\n"
56835692
" if (mPA.cols != other.mPA.cols || mPA.rows != other.mPA.rows)\n"

0 commit comments

Comments
 (0)