You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/testother.cpp
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4150,6 +4150,16 @@ class TestOther : public TestFixture {
4150
4150
" S s2{ cb };\n"
4151
4151
"}\n");
4152
4152
ASSERT_EQUALS("[test.cpp:6:11] -> [test.cpp:2:21]: (performance) Function parameter 's' should be passed by const reference. However it seems that 'cb' is a callback function. [passedByValueCallback]\n", errout_str());
4153
+
4154
+
check("struct S {\n" // #14696
4155
+
" explicit S(std::string s = {}) {}\n"
4156
+
"};\n"
4157
+
"struct T {\n"
4158
+
" explicit T(std::string* s = {}) {}\n"
4159
+
"};\n");
4160
+
ASSERT_EQUALS("[test.cpp:2:28]: (performance) Function parameter 's' should be passed by const reference. [passedByValue]\n"
4161
+
"[test.cpp:5:29]: (style) Parameter 's' can be declared as pointer to const [constParameterPointer]\n",
0 commit comments