Skip to content

Commit 07dd101

Browse files
Update teststl.cpp
1 parent 2a0a90c commit 07dd101

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎test/teststl.cpp‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7424,6 +7424,17 @@ class TestStl : public TestFixture {
74247424
dinit(CheckOptions, $.inconclusive = true));
74257425
ASSERT_EQUALS("", errout_str());
74267426

7427+
check("void f(std::map<int, bool>& m) {\n" // #15116
7428+
" if (m.count(1) != 0)\n"
7429+
" m[1] = true;\n"
7430+
"}\n"
7431+
"void g(std::map<int, bool>& m) {\n"
7432+
" if (m.count(1) == 1)\n"
7433+
" m[1] = true;\n"
7434+
"}\n",
7435+
dinit(CheckOptions, $.inconclusive = true));
7436+
ASSERT_EQUALS("", errout_str()); // TODO: warn about duplicate search
7437+
74277438
// #9218 - not small type => do not warn if cpp standard is < c++17
74287439
{
74297440
Settings s = settings;

0 commit comments

Comments
 (0)