Issue 175033
Summary [clang-tidy] `performance-for-range-copy` not reported with non-const/const overloaded member call
Labels clang-tidy, false-negative
Assignees
Reporter firewave
    ```cpp
#include <map>
#include <string>

struct S
{
    int get() const;
    int get(); // disable for warning to appear
};

std::map<std::string, S> func();

void f()
{
    const std::map<std::string, S> m = func();
 for (auto p : m) // const ref
    {
        if (p.second.get()) {}
 }
}
```
https://godbolt.org/z/3rMWfnaKq
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to