Bug 407323

Summary: suggest fixit for clazy-range-loop
Product: [Developer tools] clazy Reporter: Milian Wolff <mail>
Component: generalAssignee: Sergio Martins <smartins>
Status: RESOLVED FIXED    
Severity: normal CC: smartins
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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