diff --git a/test/testcondition.cpp b/test/testcondition.cpp index 953b0e81c85..4cf145288c5 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -5678,6 +5678,15 @@ class TestCondition : public TestFixture { "}\n"); ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:3]: (style) The if condition is the same as the previous if condition\n", errout_str()); + check("struct S { int x; };\n" // #12391 + "int f(const struct S* a, const struct S* b) {\n" + " const struct S* p = b;\n" + " if (a->x < p->x) p++;\n" + " if (a->x < p->x) p++;\n" + " return p->x;\n" + "}\n"); + ASSERT_EQUALS("", errout_str()); + // do not crash check("void assign(const MMA& other) {\n" " if (mPA.cols != other.mPA.cols || mPA.rows != other.mPA.rows)\n"