Skip to content

Commit f2a4eb8

Browse files
Update teststl.cpp
1 parent 015da40 commit f2a4eb8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/teststl.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5161,6 +5161,12 @@ class TestStl : public TestFixture {
51615161
"}\n");
51625162
ASSERT_EQUALS("[test.cpp:2:17]: (performance) Constructing a std::string from the result of c_str() is slow and redundant. [stlcstrConstructor]\n",
51635163
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());
51645170
}
51655171

51665172
void uselessCalls() {

0 commit comments

Comments
 (0)