Skip to content

Commit ed73da5

Browse files
Update teststl.cpp
1 parent dbd2e18 commit ed73da5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/teststl.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4556,6 +4556,16 @@ class TestStl : public TestFixture {
45564556
" haystack.remove(needle);"
45574557
"}");
45584558
ASSERT_EQUALS("[test.cpp:3:9]: (style) Redundant checking of STL container element existence before removing it. [redundantIfRemove]\n", errout_str());
4559+
4560+
check("void g(const std::string&);\n" // #14725
4561+
"std::set<std::string> g_s;\n"
4562+
"void f(const std::string& k) {\n"
4563+
" if (g_s.find(k) != g_s.end()) {\n"
4564+
" g_s.erase(k);\n"
4565+
" g(k);\n"
4566+
" }\n"
4567+
"}");
4568+
ASSERT_EQUALS("", errout_str());
45594569
}
45604570

45614571
void missingInnerComparison1() {

0 commit comments

Comments
 (0)