From 82edc70e0054f97291674da4d0d5976b03bfc4d4 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Thu, 25 Jun 2026 12:31:49 +0200 Subject: [PATCH 1/2] Add test for #13099 --- test/testother.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/testother.cpp b/test/testother.cpp index 1d69cf6763e..11aa7a62ac4 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -4894,6 +4894,14 @@ class TestOther : public TestFixture { "}\n"); ASSERT_EQUALS("[test.cpp:6:10]: (style) Parameter 's' can be declared as reference to const [constParameterReference]\n", errout_str()); + + check("struct S { int i; };\n" // #13099 + "double f(S * s, int n, int a, int b, double* p) {\n" + " return (s + (n * (a + 1) + b))->i / *(p + b);\n" + "}\n"); + ASSERT_EQUALS("[test.cpp:2:14]: (style) Parameter 's' can be declared as pointer to const [constParameterPointer]\n" + "[test.cpp:2:46]: (style) Parameter 'p' can be declared as pointer to const [constParameterPointer]\n", + errout_str()); } void constArray() { From abcfc6bf01196c8798074e04a7e16713f5c4a268 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Thu, 25 Jun 2026 15:19:00 +0200 Subject: [PATCH 2/2] Update testother.cpp --- test/testother.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testother.cpp b/test/testother.cpp index ad05fd65517..60323b3395b 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -4913,6 +4913,7 @@ class TestOther : public TestFixture { "}\n"); ASSERT_EQUALS("[test.cpp:2:14]: (style) Parameter 's' can be declared as pointer to const [constParameterPointer]\n" "[test.cpp:2:46]: (style) Parameter 'p' can be declared as pointer to const [constParameterPointer]\n", + errout_str()); } void constArray() {