From bc5c5ce6fd109bfb0b21ab70b7c40ef73b5d6388 Mon Sep 17 00:00:00 2001 From: chrchr Date: Fri, 28 Jul 2023 16:02:18 +0200 Subject: [PATCH] Fix merge --- test/testother.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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() {