Bug 354977 - false positives in rule-of-two-soft
Summary: false positives in rule-of-two-soft
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: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-07 07:10 UTC by Nyall Dawson
Modified: 2015-11-12 14:31 UTC (History)
2 users (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-11-07 07:10:31 UTC
I'm seeing some false positives in the rule-of-two-soft check:

- Using assign operator but class QModelIndex has copy-ctor but no assign operator 
-Using copy-ctor but class QPair has a trivial copy-ctor but non trivial assign operator 

These two classes could probably be ignored safely in the check
Comment 1 Sergio Martins 2015-11-12 12:13:55 UTC
these warnings are not false-positives, but will blacklist those classes since it can't be fixed in Qt 4, thanks
Comment 2 Sergio Martins 2015-11-12 12:44:47 UTC
Git commit 40710f301343dcf78efc78aa3c6c13b775a7b86c by Sergio Martins.
Committed on 12/11/2015 at 12:42.
Pushed by smartins into branch 'master'.

rule-of-two-soft: Blacklist some cases that are safe

We can't fix QModelIndex and QPair in Qt4, so don't warn.
In Qt5 they are fixed already.

M  +5    -1    checks/ruleofbase.cpp
M  +2    -2    tests/rule-of-two-soft/main.cpp

http://commits.kde.org/clazy/40710f301343dcf78efc78aa3c6c13b775a7b86c
Comment 3 eric.lemanissier 2015-11-12 14:31:30 UTC
I detected the following warnings for rule of three:
QTypedArrayData::iterator
QTypedArrayData::const_iterator
QStringBuilder
QVariant::Private
QSet
QSet::iterator
QSet::const_iterator

and for rule of two:
QByteRef 
QCharRef 
QVariant::Private

but i'm not sure if these should be fixed in Qt, or if they are false positives