[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [clazy] checks: rule-of-three: Don't warn for QTransform, it's fixed for Qt6
From: Sergio Martins <smartins () kde ! org>
Date: 2016-03-01 0:01:08
Message-ID: E1aaXkS-0002u7-BB () scm ! kde ! org
[Download RAW message or body]
Git commit 3ed9c67212bc311034ec725d7eeb11148a417385 by Sergio Martins.
Committed on 01/03/2016 at 00:00.
Pushed by smartins into branch 'master'.
rule-of-three: Don't warn for QTransform, it's fixed for Qt6
M +11 -0 checks/ruleofthree.cpp
M +2 -0 checks/ruleofthree.h
http://commits.kde.org/clazy/3ed9c67212bc311034ec725d7eeb11148a417385
diff --git a/checks/ruleofthree.cpp b/checks/ruleofthree.cpp
index 4491868..e71321c 100644
--- a/checks/ruleofthree.cpp
+++ b/checks/ruleofthree.cpp
@@ -87,6 +87,9 @@ void RuleOfThree::VisitDecl(clang::Decl *decl)
const int numNotImplemented = missingList.size();
const string className = record->getNameAsString();
+ if (shouldIgnoreType(className))
+ return;
+
const string classQualifiedName = record->getQualifiedNameAsString();
if (hasUserDtor && numImplemented == 1) {
@@ -145,4 +148,12 @@ std::vector<string> RuleOfThree::filesToIgnore() const
return files;
}
+bool RuleOfThree::shouldIgnoreType(const std::string &className) const
+{
+ static const vector<string> types = { "QTransform" // Fixed for Qt 6
+ };
+
+ return clazy_std::contains(types, className);
+}
+
REGISTER_CHECK_WITH_FLAGS("rule-of-three", RuleOfThree, CheckLevel2)
diff --git a/checks/ruleofthree.h b/checks/ruleofthree.h
index f1a8207..2c71662 100644
--- a/checks/ruleofthree.h
+++ b/checks/ruleofthree.h
@@ -41,6 +41,8 @@ public:
void VisitDecl(clang::Decl *d) override;
protected:
std::vector<std::string> filesToIgnore() const override;
+private:
+ bool shouldIgnoreType(const std::string &className) const;
};
#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic