| Summary: | false positive for reserve candidate | ||
|---|---|---|---|
| Product: | [Developer tools] clazy | Reporter: | eric.lemanissier |
| Component: | general | Assignee: | Sergio Martins <smartins> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | smartins |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Other | ||
| Latest Commit: | http://commits.kde.org/clazy/ce9f92e2ba0cb3823983d75637487f85905a7665 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
I forgot to mention the following: m_tmpBuf is a QQueue and vect is a QVector Git commit d4205769b406d526c706118cbb34ffaeb2103785 by Sergio Martins. Committed on 11/05/2016 at 17:54. Pushed by smartins into branch 'master'. Add test-case for false positive M +10 -0 tests/reserve-candidates/main.cpp http://commits.kde.org/clazy/d4205769b406d526c706118cbb34ffaeb2103785 Git commit ce9f92e2ba0cb3823983d75637487f85905a7665 by Sergio Martins. Committed on 14/05/2016 at 18:02. Pushed by smartins into branch 'master'. Make Utils::valueDeclForOperatorCall() more robust. There were situations where we were picking the wrong DeclRefExpr. Unit-test already added in reserve-candidates/main.cpp M +13 -9 Utils.cpp http://commits.kde.org/clazy/ce9f92e2ba0cb3823983d75637487f85905a7665 |
In the following code, I get the warning "Reserve candidate [-Wclazy-reserve-candidates]" on the last line: m_tmpBuf.reserve(m_tmpBuf.size() + vect.size()); for(const auto &i:vect) { m_tmpBuf << i; } Reproducible: Always