File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -4568,6 +4568,14 @@ class TestStl : public TestFixture {
45684568 " [test.cpp:14:10]: (performance) Passing the result of c_str() to a stream is slow and redundant. [stlcstrStream]\n " ,
45694569 errout_str ());
45704570
4571+ check (" void f(const std::string& s) {\n "
4572+ " std::cout << s.c_str();\n "
4573+ " std::cerr << s.c_str();\n "
4574+ " }\n " );
4575+ ASSERT_EQUALS (" [test.cpp:2:15]: (performance) Passing the result of c_str() to a stream is slow and redundant. [stlcstrStream]\n "
4576+ " [test.cpp:3:15]: (performance) Passing the result of c_str() to a stream is slow and redundant. [stlcstrStream]\n " ,
4577+ errout_str ());
4578+
45714579 check (" struct S { std::string str; };\n "
45724580 " struct T { S s; };\n "
45734581 " struct U { T t[1]; };\n "
You can’t perform that action at this time.
0 commit comments