[clang-tools-extra] [clang-tidy] New checker: modernize.use-std-bit to detect std::has_one_bit idiom (PR #185435)
Victor Chernyakin via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 9 08:25:54 PDT 2026
localspook wrote:
Here's another idea for future extension: replacing `std::bitset<K>(N).count()` with `std::popcount(N)`. We actually have cases of this in the LLVM codebase, e.g.:
https://github.com/llvm/llvm-project/blob/0bf9bb5c42c625c513484bc6224a9fc85c7e25fb/llvm/lib/Support/Windows/Threading.inc#L238
https://github.com/llvm/llvm-project/pull/185435
More information about the cfe-commits
mailing list