Skip to content

Commit a61e586

Browse files
Update testother.cpp
1 parent 1a8ebb2 commit a61e586

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
@@ -4749,6 +4749,18 @@ class TestOther : public TestFixture {
47494749
" return [](int* p) { return *p; }(&i);\n"
47504750
"}\n");
47514751
ASSERT_EQUALS("[test.cpp:3:20]: (style) Parameter 'p' can be declared as pointer to const [constParameterPointer]\n", errout_str());
4752+
4753+
check("struct S {\n" // #14571
4754+
" char* c;\n"
4755+
"};\n"
4756+
"struct T {\n"
4757+
" S s;\n"
4758+
"};\n"
4759+
"void f(std::string* p, T& t) {\n"
4760+
" S& r = t.s;\n"
4761+
" strcpy(r.c, p->c_str());\n"
4762+
"}\n");
4763+
ASSERT_EQUALS("[test.cpp:7:21]: (style) Parameter 'p' can be declared as pointer to const [constParameterPointer]\n", errout_str());
47524764
}
47534765

47544766
void constArray() {

0 commit comments

Comments
 (0)