Skip to content

Commit b60cfa8

Browse files
Update testother.cpp
1 parent 5a36332 commit b60cfa8

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test/testother.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4864,6 +4864,18 @@ class TestOther : public TestFixture {
48644864
ASSERT_EQUALS("[test.cpp:1:12]: (style) Parameter 'p' can be declared as pointer to const [constParameterPointer]\n"
48654865
"[test.cpp:1:20]: (style) Parameter 'q' can be declared as pointer to const [constParameterPointer]\n",
48664866
errout_str());
4867+
4868+
check("struct S { std::string a; };\n" // #13678
4869+
"struct T { S s; };\n"
4870+
"bool f(S* s) {\n"
4871+
" return s->a.empty();\n"
4872+
"}\n"
4873+
"bool g(T* t) {\n"
4874+
" return t->s.a.empty();\n"
4875+
"}\n");
4876+
ASSERT_EQUALS("[test.cpp:3:11]: (style) Parameter 's' can be declared as pointer to const [constParameterPointer]\n"
4877+
"[test.cpp:6:11]: (style) Parameter 't' can be declared as pointer to const [constParameterPointer]\n",
4878+
errout_str());
48674879
}
48684880

48694881
void constArray() {

0 commit comments

Comments
 (0)