We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1a8ebb2 commit a61e586Copy full SHA for a61e586
1 file changed
test/testother.cpp
@@ -4749,6 +4749,18 @@ class TestOther : public TestFixture {
4749
" return [](int* p) { return *p; }(&i);\n"
4750
"}\n");
4751
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
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());
4764
}
4765
4766
void constArray() {
0 commit comments