Issue 124963
Summary [clang-tidy] modernize-use-ranges: detect unnecessary begin()/end() usage
Labels clang-tidy
Assignees
Reporter chrchr-github
    ~~~c++
#include <vector>
#include <algorithm>
#include <ranges>

bool f(const std::vector<int>& v) {
    return std::ranges::find(v.begin(), v.end(), 0) == v.end(); // should be return std::ranges::find(v, 0) == v.end();
}

int main() {
    std::vector a{ 1, 2, 3, 0};
    return f(a);
}
~~~
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to