Bug 356755 - detaching-member: don't warn when begin()/end() used in qSort
Summary: detaching-member: don't warn when begin()/end() used in qSort
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: 2015-12-15 22:45 UTC by Nyall Dawson
Modified: 2015-12-16 23:12 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 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