We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://godbolt.org/z/EWo1cTYGK
#include <vector> void f(std::vector<int>& r) { std::vector<int> v; for (std::size_t i = 0; i < r.size(); ++i) { v.push_back(r[i]); } } void g(std::vector<int>& r) { std::vector<int> v; for (int i = 0; i < r.size(); ++i) { v.push_back(r[i]); } }
The only difference is the loop variable i's type being std::size_t or int, but the check only warns to reserve for int i in g
i
std::size_t
int
int i
g
The text was updated successfully, but these errors were encountered:
[clang-tidy] fix false negatives for performance-inefficient-vector-o…
5a4a4aa
…peration Fixes: llvm#95596 Check will warn if the loop var type is not same as var init expr type
dcbe0d4
Remove fixme
b664217
Fixed by llvm#95596
HerrCai0907
Successfully merging a pull request may close this issue.
https://godbolt.org/z/EWo1cTYGK
The only difference is the loop variable
i
's type beingstd::size_t
orint
, but the check only warns to reserve forint i
ing
The text was updated successfully, but these errors were encountered: