1 parent 015da40 commit f2a4eb8Copy full SHA for f2a4eb8
1 file changed
test/teststl.cpp
@@ -5161,6 +5161,12 @@ class TestStl : public TestFixture {
5161
"}\n");
5162
ASSERT_EQUALS("[test.cpp:2:17]: (performance) Constructing a std::string from the result of c_str() is slow and redundant. [stlcstrConstructor]\n",
5163
errout_str());
5164
+
5165
+ check("void f(std::string& a, const std::string& b) {\n"
5166
+ " a += b.c_str();\n"
5167
+ "}\n");
5168
+ ASSERT_EQUALS("[test.cpp:2:7]: (performance) Concatenating the result of c_str() and a std::string is slow and redundant. [stlcstrConcat]\n",
5169
+ errout_str());
5170
}
5171
5172
void uselessCalls() {
0 commit comments