diff options
author | flovent <flbven@protonmail.com> | 2025-07-02 22:41:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-02 17:41:24 +0300 |
commit | 5a8d096ae3443909bbcc87465653c15b58bc2e11 (patch) | |
tree | 497a430eb22a1306d12e431a012ba2a934bb17fb /clang/lib/CIR/CodeGen/CIRGenModule.cpp | |
parent | cbfd0d68ea5084704bd9ff0c6c51e04fa3fff4be (diff) | |
download | llvm-5a8d096ae3443909bbcc87465653c15b58bc2e11.zip llvm-5a8d096ae3443909bbcc87465653c15b58bc2e11.tar.gz llvm-5a8d096ae3443909bbcc87465653c15b58bc2e11.tar.bz2 |
[clang-tidy] Fix false positive for cppcoreguidelines-pro-bounds-pointer-arithmetic (#127394)
this PR fixes #126424
for `ArraySubScriptExpr`, `hasBase` Matcher will get right operand when
it is not integer type, but is not for sure that left operand is integer
type. For the example code below `hasBase` will get `r` for the
Subsequent matching and causing false positive.
```
template <typename R>
int f(std::map<R*, int>& map, R* r) {
return map[r];
}
```
so is needed to see if index is integer type to avoid this situation.
Diffstat (limited to 'clang/lib/CIR/CodeGen/CIRGenModule.cpp')
0 files changed, 0 insertions, 0 deletions