Skip to content

Commit 82edc70

Browse files
Add test for #13099
1 parent 887b5d2 commit 82edc70

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
@@ -4894,6 +4894,14 @@ class TestOther : public TestFixture {
48944894
"}\n");
48954895
ASSERT_EQUALS("[test.cpp:6:10]: (style) Parameter 's' can be declared as reference to const [constParameterReference]\n",
48964896
errout_str());
4897+
4898+
check("struct S { int i; };\n" // #13099
4899+
"double f(S * s, int n, int a, int b, double* p) {\n"
4900+
" return (s + (n * (a + 1) + b))->i / *(p + b);\n"
4901+
"}\n");
4902+
ASSERT_EQUALS("[test.cpp:2:14]: (style) Parameter 's' can be declared as pointer to const [constParameterPointer]\n"
4903+
"[test.cpp:2:46]: (style) Parameter 'p' can be declared as pointer to const [constParameterPointer]\n",
4904+
errout_str());
48974905
}
48984906

48994907
void constArray() {

0 commit comments

Comments
 (0)