Bug 356755

Summary: detaching-member: don't warn when begin()/end() used in qSort
Product: [Developer tools] clazy Reporter: Nyall Dawson <nyall.dawson>
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 Nyall Dawson 2015-12-15 22:45:14 UTC
The following snippet shows a warning when using the detaching-member check:

qSort( list.begin(), list..end(), valueLessThan );

There's no way of avoiding a detachment in this case, so ideally no warning would be shown.
Comment 1 Sergio Martins 2015-12-16 23:12:31 UTC
Git commit 3e5888063b8bd4927971251c598423ccaf107a86 by Sergio Martins.
Committed on 16/12/2015 at 23:11.
Pushed by smartins into branch 'master'.

detaching-member: Don't warn when passing to a function taking iterators

qSort(list.begin(), list.end()) is fine.

M  +27   -0    checks/detachingmember.cpp
M  +6    -0    tests/detaching-member/main.cpp

http://commits.kde.org/clazy/3e5888063b8bd4927971251c598423ccaf107a86