[clang-tools-extra] [clang-tidy] Use llvm::none_of (NFC) (PR #151801)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 2 09:56:22 PDT 2025


kazutakahirata wrote:

> As a side note, should we create a clang-tidy check to detect these cases automatically: to use `llvm` algorithms instead of `std` and so on? Is it documented that we should always prefer the `llvm` version? I see a lot of work by @kazutakahirata and wish to make it future-proof because any new contributor could use `std` version as it is the most familiar one.

Yes, a clang-tidy check would be useful.  Detecting the case in this particular PR may require some heuristics though.  For example, if we see `enumerator_begin()` and `enumerator_end()`, then check for `enumerators()` (the plural form after removing `begin`).

https://github.com/llvm/llvm-project/pull/151801


More information about the cfe-commits mailing list