diff --git a/test/testother.cpp b/test/testother.cpp index ed348a18a46..adc19dfc081 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -3786,6 +3786,14 @@ class TestOther : public TestFixture { " p = q;\n" "}\n"); ASSERT_EQUALS("", errout.str()); + + + check("struct S { int a[1]; };\n" + "void f(S* s) {\n" + " if (s->a[0]) {}\n" + "}\n"); + ASSERT_EQUALS("[test.cpp:2]: (style) Parameter 's' can be declared as pointer to const\n", + errout.str()); } void switchRedundantAssignmentTest() {