| Issue |
180410
|
| Summary |
[clang-tidy] `readability-container-contains` gives invalid fix-its
|
| Labels |
clang-tidy
|
| Assignees |
|
| Reporter |
XGPSPL
|
**Environment:**
- Clang-Tidy Version: LLVM version 23.0.0git (Optimized build with assertions)
- Commit Hash: [`5654ecd5ddeb2f40e124a6bf10cc78230da4ef49`](https://github.com/llvm/llvm-project/commit/5654ecd5ddeb2f40e124a6bf10cc78230da4ef49)
- Platform: Linux 6.18.6
**Reproducer:**
```c++
struct S {
int count(int);
bool contains(const char*) const;
};
void test_invalid_fix() {
S s;
// Suggests replacement to 's.contains(1)', which fails to compile.
if (s.count(1) > 0) {}
}
```
**Godbolt:** https://clang-tidy.godbolt.org/z/1o9hjvEEv
**AI Usage:** This issue was found using an LLM-Assisted Fuzzer and verified by a human.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs