Bug 407323 - suggest fixit for clazy-range-loop
Summary: suggest fixit for clazy-range-loop
Status: RESOLVED FIXED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Sergio Martins
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-08 07:39 UTC by Milian Wolff
Modified: 2019-05-08 09:47 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milian Wolff 2019-05-08 07:39:26 UTC
SUMMARY
currently the clazy report doesn't suggest qAsConst fixit directly, it's only suggested in the documentation of the clazy-range-loop warning.

OBSERVED RESULT
line 468: for (const auto &p : mParameters)
=> c++11 range-loop might detach Qt container (QVector)

EXPECTED RESULT
line 468: for (const auto &p : mParameters)
=> c++11 range-loop might detach Qt container (QVector), use qAsConst(mParameters)

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Milian Wolff 2019-05-08 07:39:51 UTC
Qt 5.7 is old enough by now
Comment 2 Sergio Martins 2019-05-08 09:47:32 UTC
Git commit 9c8ade0c72a9ca371a0333bccdc297dc20f0643f by Sergio Martins.
Committed on 08/05/2019 at 09:46.
Pushed by smartins into branch 'master'.

range-loop: Specify in the README that we have a fixit for adding qAsConst

M  +1    -3    docs/checks/README-range-loop.md

https://commits.kde.org/clazy/9c8ade0c72a9ca371a0333bccdc297dc20f0643f