[PATCH] D112646: [clang-tidy] Add `readability-container-contains` check

Whisperity via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 28 00:25:05 PDT 2021


whisperity added reviewers: aaron.ballman, xazax.hun.
whisperity added a comment.
Herald added a subscriber: rnkovacs.

Why `readability-`, if the intent is to make users move to a newer API?

@xazax.hun I think you did something similar wrt. `empty()`, right? Could you take a look at this?



================
Comment at: clang-tools-extra/docs/clang-tidy/checks/list.rst:341-343
+   `cert-exp42-c <cert-exp42-c.html>`_, `bugprone-suspicious-memory-comparison <bugprone-suspicious-memory-comparison.html>`_,
    `cert-fio38-c <cert-fio38-c.html>`_, `misc-non-copyable-objects <misc-non-copyable-objects.html>`_,
+   `cert-flp37-c <cert-flp37-c.html>`_, `bugprone-suspicious-memory-comparison <bugprone-suspicious-memory-comparison.html>`_,
----------------
These are unrelated changes coming from a lack of rebase or a too eager diff.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/readability-container-contains.rst:15
+-------------------------------------------  ------------------------------
+``x.begin() == x.end()``                       ``!myMap.contains(x)``
+``x.begin() != x.end()``                       ``myMap.contains(x)``
----------------
The indentation looks offset for the 2nd column here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112646/new/

https://reviews.llvm.org/D112646



More information about the cfe-commits mailing list