❯ clang-tidy --version
LLVM (http://llvm.org/):
LLVM version 19.1.4
Optimized build.
❯ cat m.cpp
#include <map>
template <typename R>
int f(std::map<R*, int>& map, R* r) {
return map[r];
}
❯ clang-tidy "--checks=-*,cppcoreguidelines-pro-bounds-pointer-arithmetic" -quiet m.cpp --
67 warnings generated.
/workspaces/ix/ct_bug_1/m.cpp:4:14: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
4 | return map[r];
| ^