Skip to content

Commit 6602ba1

Browse files
Update teststl.cpp
1 parent 72547b3 commit 6602ba1

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
@@ -4835,6 +4835,12 @@ class TestStl : public TestFixture {
48354835
"[test.cpp:3:5]: (warning) Return value of std::remove_if() ignored. Elements remain in container. [uselessCallsRemove]\n"
48364836
"[test.cpp:4:5]: (warning) Return value of std::unique() ignored. Elements remain in container. [uselessCallsRemove]\n", errout_str());
48374837

4838+
check("void f(std::string& s) {\n" // #14764
4839+
" auto it{ std::remove(s.begin(), s.end(), 'a') };\n"
4840+
" s.erase(it, s.end());\n"
4841+
"}");
4842+
ASSERT_EQUALS("", errout_str());
4843+
48384844
// #4431 - fp
48394845
check("bool f() {\n"
48404846
" return x ? true : (y.empty());\n"

0 commit comments

Comments
 (0)