Skip to content

Commit b37e6b8

Browse files
Add test for #13099 (#8674)
1 parent d8eaa52 commit b37e6b8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/testother.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4906,6 +4906,14 @@ class TestOther : public TestFixture {
49064906
ASSERT_EQUALS("[test.cpp:3:11]: (style) Parameter 's' can be declared as pointer to const [constParameterPointer]\n"
49074907
"[test.cpp:6:11]: (style) Parameter 't' can be declared as pointer to const [constParameterPointer]\n",
49084908
errout_str());
4909+
4910+
check("struct S { int i; };\n" // #13099
4911+
"double f(S * s, int n, int a, int b, double* p) {\n"
4912+
" return (s + (n * (a + 1) + b))->i / *(p + b);\n"
4913+
"}\n");
4914+
ASSERT_EQUALS("[test.cpp:2:14]: (style) Parameter 's' can be declared as pointer to const [constParameterPointer]\n"
4915+
"[test.cpp:2:46]: (style) Parameter 'p' can be declared as pointer to const [constParameterPointer]\n",
4916+
errout_str());
49094917
}
49104918

49114919
void constArray() {

0 commit comments

Comments
 (0)