[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 2 05:31:47 PDT 2024


whisperity wrote:

What happens in the following case?

```cpp
std::vector V;
const auto& V2 = V;

std::find(V.begin(), V2.end(), 42);
```

These are syntactically different symbols, but still should be the same underlying memory area. Perhaps it could be mentioned in the documentation, that the Clang Static Analyser has (albeit only as alpha...) some iterator-related checkers as well, where range constraints are (attempted to be?) modelled path sensitively.

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


More information about the cfe-commits mailing list