<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/79437>79437</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy: checks "readability-container-contains" does not handle "find()"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          adesitter
      </td>
    </tr>
</table>

<pre>
    $ cat qq.cpp 
#include <map>
bool my_contains_1(std::map<int, int> const& m, int key)
{
   return m.find(key) != m.end(); 
}
bool my_contains_2(std::map<int, int> const& m, int key)
{
   return m.count(key) > 0; 
}
$ /usr/local/clang-17/bin/clang-tidy '-checks=readability-container-contains' contains.cpp -- -std=c++20
1 warning generated.
/tmp/contains.cpp:8:13: warning: use 'contains' to check for membership [readability-container-contains]
    8 |    return m.count(key) > 0; 
      |             ^~~~~      ~~~
      | contains

Despite https://clang.llvm.org/extra/clang-tidy/checks/readability/container-contains.html, readability-container-contains" does not handle "find()".

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VM-SsygQf5r20qWlTYzJwUMS42tMIZLIDooDOLu55Nm30JjJbO3WbNVXH4fQkG74_WnkzqnrIGUJ-RHyKuKT74wteSud8l7aqDHtrQTaoOAePz4SMY4IaQXpAYipQeiplQjs1PMR2Hn5pzFGY397E2bwXA3uLQPaOd8COwA7zJknNXigE4aJnVGYwXmgLfaPTXyXN6D946biuASIaKWf7IB9clFDC7Rb8hAoA1Zhn8h5N5Sy4wq0qP4DF_0GXMJM4YgnMHbG9F-wBEmB6slZoFobwTVQLTQfrnFWANWNGp4bXrU3BCpi0Unx7oBVVvKWN0orf4sfbKRdIwdU4BrPhsUxxjPPSgAdgY6ULigy_JPbQQ1XvMpBWu5lm6z4at-PAcLLQcAOO2CHjAE7rJUhnJwM-F7v9wZntHgxFnvZN9K6To0I-fEH8Hn1FBV3CMUJ_7-8OI9HzXNAfr7f7_dlcb_f_5n7vHphPv9W0o3KS-y8H11oEKpXPxKtP_vE2CtQLf_yln8zKiwWm6h-Yfql5AvXpPO9Dp31k5-ErZEOB-Ox40Org9z0eAGhHYketkVtydo92_NIllmRbrMd5fs06sqMsUJQs0mbZp83xX7LuaB8WzRcXkiyS6RKSmmTZpRnGduyNKFciKZgGcs3LL-QhE0qe670k36knJtkWew3rIg0b6R262fEliEpbqarg02qlfPuq8wrr2X5ohg7LL3iAqtflyKarC6_-3ZVvpuaRJg-vDb9uU7xaM0fUnigeiYTTJv5_B0AAP__v12OrQ">