Skip to content

Commit c359ded

Browse files
Update teststl.cpp
1 parent f6b00d6 commit c359ded

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
@@ -4713,6 +4713,12 @@ class TestStl : public TestFixture {
47134713
ASSERT_EQUALS("[test.cpp:3:5]: (performance) Assigning the result of c_str() to a std::string is slow and redundant. [stlcstrAssignment]\n"
47144714
"[test.cpp:4:17]: (performance) Constructing a std::string from the result of c_str() is slow and redundant. [stlcstrConstructor]\n",
47154715
errout_str());
4716+
4717+
check("void f() {\n"
4718+
" std::string s;\n"
4719+
" auto a = + s.c_str();\n"
4720+
"}\n");
4721+
ASSERT_EQUALS("", errout_str());
47164722
}
47174723

47184724
void uselessCalls() {

0 commit comments

Comments
 (0)