[neon/extras/clazy/Neon/release] debian: update the patches

Pino Toscano null at kde.org
Wed Sep 7 22:14:01 BST 2022


Git commit 7b3fc610d29a1e3cc640e24ea16dc626381c5b4b by Pino Toscano.
Committed on 23/11/2020 at 13:36.
Pushed by jriddell into branch 'Neon/release'.

update the patches

- upstream_inefficient-qlist-Disable-flaky-test-on-arm-32bit.patch:
  drop, backported from upstream
- upstream_updated-for-compatibility-with-LLVM-10.patch: drop,
  backported from upstream
- upstream_deleted-redundant-qualifier.patch: drop, backported from
  upstream
- upstream_updated-for-compatibility-with-LLVM-10-clazy-standal.patch:
  drop, backported from upstream

M  +9    -0    debian/changelog
M  +0    -4    debian/patches/series
D  +0    -115  debian/patches/upstream_deleted-redundant-qualifier.patch
D  +0    -84   debian/patches/upstream_inefficient-qlist-Disable-flaky-test-on-arm-32bit.patch
D  +0    -28   debian/patches/upstream_updated-for-compatibility-with-LLVM-10-clazy-standal.patch
D  +0    -343  debian/patches/upstream_updated-for-compatibility-with-LLVM-10.patch

https://invent.kde.org/neon/extras/clazy/commit/7b3fc610d29a1e3cc640e24ea16dc626381c5b4b

diff --git a/debian/changelog b/debian/changelog
index ab2f240..1addcca 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,15 @@ clazy (1.8-0r1) UNRELEASED; urgency=medium
 
   [ Pino Toscano ]
   * New upstream release.
+  * Update the patches:
+    - upstream_inefficient-qlist-Disable-flaky-test-on-arm-32bit.patch: drop,
+      backported from upstream
+    - upstream_updated-for-compatibility-with-LLVM-10.patch: drop, backported
+      from upstream
+    - upstream_deleted-redundant-qualifier.patch: drop, backported from
+      upstream
+    - upstream_updated-for-compatibility-with-LLVM-10-clazy-standal.patch:
+      drop, backported from upstream
 
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Mon, 23 Nov 2020 14:25:32 +0100
 
diff --git a/debian/patches/series b/debian/patches/series
index af78fa3..6c48ffb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,6 +1,2 @@
-upstream_inefficient-qlist-Disable-flaky-test-on-arm-32bit.patch
-upstream_updated-for-compatibility-with-LLVM-10.patch
-upstream_deleted-redundant-qualifier.patch
-upstream_updated-for-compatibility-with-LLVM-10-clazy-standal.patch
 debian-tests-link-atomic.diff
 select-clangpp.diff
diff --git a/debian/patches/upstream_deleted-redundant-qualifier.patch b/debian/patches/upstream_deleted-redundant-qualifier.patch
deleted file mode 100644
index d5b54a5..0000000
--- a/debian/patches/upstream_deleted-redundant-qualifier.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From 86796d87c9118cec4795d77349e3e607df35c3b8 Mon Sep 17 00:00:00 2001
-From: Egor Gabov <egor.gabov at waveaccess.ru>
-Date: Thu, 4 Jun 2020 18:09:17 +0300
-Subject: [PATCH] deleted redundant qualifier
-
-deleted redundant qualifier from std::string.
-This means: std::string -> string
----
- src/Utils.cpp                                      | 2 +-
- src/checkbase.cpp                                  | 2 +-
- src/checks/level0/qenums.cpp                       | 2 +-
- src/checks/level2/old-style-connect.cpp            | 6 +++---
- src/checks/level2/rule-of-three.cpp                | 2 +-
- src/checks/manuallevel/qproperty-type-mismatch.cpp | 2 +-
- 6 files changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/src/Utils.cpp b/src/Utils.cpp
-index b0812fe..c4a40c0 100644
---- a/src/Utils.cpp
-+++ b/src/Utils.cpp
-@@ -878,7 +878,7 @@ string Utils::filenameForLoc(SourceLocation loc, const clang::SourceManager &sm)
-     if (loc.isMacroID())
-         loc = sm.getExpansionLoc(loc);
- 
--    const string filename = static_cast<std::string>(sm.getFilename(loc));
-+    const string filename = static_cast<string>(sm.getFilename(loc));
-     auto splitted = clazy::splitString(filename, '/');
-     if (splitted.empty())
-         return {};
-diff --git a/src/checkbase.cpp b/src/checkbase.cpp
-index 22a426c..58bbc8e 100644
---- a/src/checkbase.cpp
-+++ b/src/checkbase.cpp
-@@ -188,7 +188,7 @@ bool CheckBase::shouldIgnoreFile(SourceLocation loc) const
-     if (!loc.isValid())
-         return true;
- 
--    string filename = static_cast<std::string>(sm().getFilename(loc));
-+    string filename = static_cast<string>(sm().getFilename(loc));
- 
-     return clazy::any_of(m_filesToIgnore, [filename](const std::string &ignored) {
-         return clazy::contains(filename, ignored);
-diff --git a/src/checks/level0/qenums.cpp b/src/checks/level0/qenums.cpp
-index db8910f..e28e9a7 100644
---- a/src/checks/level0/qenums.cpp
-+++ b/src/checks/level0/qenums.cpp
-@@ -59,7 +59,7 @@ void QEnums::VisitMacroExpands(const Token &MacroNameTok, const SourceRange &ran
-         // We simply check if :: is present because it's very cumbersome to to check for different classes when dealing with the pre-processor
- 
-         CharSourceRange crange = Lexer::getAsCharRange(range, sm(), lo());
--        string text = static_cast<std::string>(Lexer::getSourceText(crange, sm(), lo()));
-+        string text = static_cast<string>(Lexer::getSourceText(crange, sm(), lo()));
-         if (clazy::contains(text, "::"))
-             return;
-     }
-diff --git a/src/checks/level2/old-style-connect.cpp b/src/checks/level2/old-style-connect.cpp
-index 396cb70..77626fa 100644
---- a/src/checks/level2/old-style-connect.cpp
-+++ b/src/checks/level2/old-style-connect.cpp
-@@ -274,7 +274,7 @@ void OldStyleConnect::VisitMacroExpands(const Token &macroNameTok, const SourceR
-         return;
- 
-     auto charRange = Lexer::getAsCharRange(range, sm(), lo());
--    const string text = static_cast<std::string>(Lexer::getSourceText(charRange, sm(), lo()));
-+    const string text = static_cast<string>(Lexer::getSourceText(charRange, sm(), lo()));
- 
-     static regex rx(R"(Q_PRIVATE_SLOT\s*\((.*)\s*,\s*.*\s+(.*)\(.*)");
-     smatch match;
-@@ -293,7 +293,7 @@ string OldStyleConnect::signalOrSlotNameFromMacro(SourceLocation macroLoc)
-     CharSourceRange expansionRange = clazy::getImmediateExpansionRange(macroLoc, sm());
-     SourceRange range = SourceRange(expansionRange.getBegin(), expansionRange.getEnd());
-     auto charRange = Lexer::getAsCharRange(range, sm(), lo());
--    const string text = static_cast<std::string>(Lexer::getSourceText(charRange, sm(), lo()));
-+    const string text = static_cast<string>(Lexer::getSourceText(charRange, sm(), lo()));
- 
-     static regex rx(R"(\s*(SIGNAL|SLOT)\s*\(\s*(.+)\s*\(.*)");
- 
-@@ -315,7 +315,7 @@ bool OldStyleConnect::isSignalOrSlot(SourceLocation loc, string &macroName) cons
-     if (!loc.isMacroID() || loc.isInvalid())
-         return false;
- 
--    macroName = static_cast<std::string>(Lexer::getImmediateMacroName(loc, sm(), lo()));
-+    macroName = static_cast<string>(Lexer::getImmediateMacroName(loc, sm(), lo()));
-     return macroName == "SIGNAL" || macroName == "SLOT";
- }
- 
-diff --git a/src/checks/level2/rule-of-three.cpp b/src/checks/level2/rule-of-three.cpp
-index 7583fcc..8073103 100644
---- a/src/checks/level2/rule-of-three.cpp
-+++ b/src/checks/level2/rule-of-three.cpp
-@@ -140,7 +140,7 @@ void RuleOfThree::VisitDecl(clang::Decl *decl)
- 
-     const string className = record->getNameAsString();
-     const string classQualifiedName = record->getQualifiedNameAsString();
--    const string filename = static_cast<std::string>(sm().getFilename(recordStart));
-+    const string filename = static_cast<string>(sm().getFilename(recordStart));
-     if (clazy::endsWith(className, "Private") && clazy::endsWithAny(filename, { ".cpp", ".cxx", "_p.h" }))
-         return; // Lots of RAII classes fall into this category. And even Private (d-pointer) classes, warning in that case would just be noise
- 
-diff --git a/src/checks/manuallevel/qproperty-type-mismatch.cpp b/src/checks/manuallevel/qproperty-type-mismatch.cpp
-index 952d9f1..01ddb1f 100644
---- a/src/checks/manuallevel/qproperty-type-mismatch.cpp
-+++ b/src/checks/manuallevel/qproperty-type-mismatch.cpp
-@@ -237,7 +237,7 @@ void QPropertyTypeMismatch::VisitMacroExpands(const clang::Token &MacroNameTok,
- 
-     CharSourceRange crange = Lexer::getAsCharRange(range, sm(), lo());
- 
--    string text = static_cast<std::string>(Lexer::getSourceText(crange, sm(), lo()));
-+    string text = static_cast<string>(Lexer::getSourceText(crange, sm(), lo()));
-     if (!text.empty() && text.back() == ')')
-         text.pop_back();
- 
--- 
-2.28.0
-
diff --git a/debian/patches/upstream_inefficient-qlist-Disable-flaky-test-on-arm-32bit.patch b/debian/patches/upstream_inefficient-qlist-Disable-flaky-test-on-arm-32bit.patch
deleted file mode 100644
index be0f2bc..0000000
--- a/debian/patches/upstream_inefficient-qlist-Disable-flaky-test-on-arm-32bit.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From dbde38f1a67c2968c951629a5f5629c9847078bd Mon Sep 17 00:00:00 2001
-From: Sergio Martins <smartins at kde.org>
-Date: Wed, 1 Jul 2020 18:57:50 +0100
-Subject: [PATCH] inefficient-qlist: Disable flaky test on arm 32bit
-
-This check will be disabled in master, so no point wasting time.
-People are already (re-)porting QVector->QList due to Qt6 changes,
-so let's not confuse people more.
-
-CCBUG: 413169
----
- tests/inefficient-qlist/config.json |  3 ++-
- tests/run_tests.py                  | 13 ++++++++++++-
- 2 files changed, 14 insertions(+), 2 deletions(-)
-
-diff --git a/tests/inefficient-qlist/config.json b/tests/inefficient-qlist/config.json
-index e7e6e0c..bd7aeb6 100644
---- a/tests/inefficient-qlist/config.json
-+++ b/tests/inefficient-qlist/config.json
-@@ -1,7 +1,8 @@
- {
-     "tests" : [
-         {
--            "filename" : "main.cpp"
-+            "filename" : "main.cpp",
-+            "should_run_on_32bit" : false
-         }
-     ]
- }
-diff --git a/tests/run_tests.py b/tests/run_tests.py
-index 5dc6a40..bfc7ae7 100755
---- a/tests/run_tests.py
-+++ b/tests/run_tests.py
-@@ -46,6 +46,7 @@ class Test:
-         self.ignore_dirs = ""
-         self.has_fixits = False
-         self.should_run_fixits_test = False
-+        self.should_run_on_32bit = True
- 
-     def filename(self):
-         if len(self.filenames) == 1:
-@@ -239,6 +240,8 @@ def load_json(check_name):
-                 test.header_filter = t['header_filter']
-             if 'ignore_dirs' in t:
-                 test.ignore_dirs = t['ignore_dirs']
-+            if 'should_run_on_32bit' in t:
-+                test.should_run_on_32bit = t['should_run_on_32bit']
- 
-             if not test.checks:
-                 test.checks.append(test.check.name)
-@@ -558,6 +561,9 @@ def file_contains(filename, text):
-     f.close()
-     return text in contents
- 
-+def is32Bit():
-+    return platform.architecture()[0] == '32bit'
-+
- def run_unit_test(test, is_standalone):
-     if test.check.clazy_standalone_only and not is_standalone:
-         return True
-@@ -579,6 +585,11 @@ def run_unit_test(test, is_standalone):
-             print("Skipping " + test.check.name + " because it is blacklisted for this platform")
-         return True
- 
-+    if not test.should_run_on_32bit and is32Bit():
-+        if (_verbose):
-+            print("Skipping " + test.check.name + " because it is blacklisted on 32bit")
-+        return True;
-+
-     checkname = test.check.name
-     filename = checkname + "/" + test.filename()
- 
-@@ -587,7 +598,7 @@ def run_unit_test(test, is_standalone):
-     expected_file = filename + ".expected"
- 
-     # Some tests have different output on 32 bit
--    if platform.architecture()[0] == '32bit' and os.path.exists(expected_file + '.x86'):
-+    if is32Bit() and os.path.exists(expected_file + '.x86'):
-         expected_file = expected_file + '.x86'
- 
-     if is_standalone and test.isScript():
--- 
-2.27.0
-
diff --git a/debian/patches/upstream_updated-for-compatibility-with-LLVM-10-clazy-standal.patch b/debian/patches/upstream_updated-for-compatibility-with-LLVM-10-clazy-standal.patch
deleted file mode 100644
index 16f1797..0000000
--- a/debian/patches/upstream_updated-for-compatibility-with-LLVM-10-clazy-standal.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 25aa102cc49def9573ffbed88155589cd60a2e8f Mon Sep 17 00:00:00 2001
-From: Egor Gabov <egor.gabov at waveaccess.ru>
-Date: Fri, 5 Jun 2020 16:52:53 +0300
-Subject: [PATCH] updated for compatibility with LLVM 10 (clazy-standalone)
-
-In LLVM 10 llvm::StringRef operator std::string() is marked as explicit.
-In this commit all implicit conversion from llvm::StringRef to
-std::string are changed by explicit.
----
- src/checks/manuallevel/jnisignatures.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/checks/manuallevel/jnisignatures.cpp b/src/checks/manuallevel/jnisignatures.cpp
-index 81e61d4..5d4fe20 100644
---- a/src/checks/manuallevel/jnisignatures.cpp
-+++ b/src/checks/manuallevel/jnisignatures.cpp
-@@ -103,7 +103,7 @@ void JniSignatures::checkFunctionCall(Stmt *stm)
-         return;
-     }
- 
--    const std::string name = clazy::name(funDecl);
-+    const std::string name = static_cast<std::string>(clazy::name(funDecl));
- 
-     if (name == "callObjectMethod" || name == "callMethod") {
-         checkArgAt(callExpr, 0, methodNameRegex, "Invalid method name");
--- 
-2.28.0
-
diff --git a/debian/patches/upstream_updated-for-compatibility-with-LLVM-10.patch b/debian/patches/upstream_updated-for-compatibility-with-LLVM-10.patch
deleted file mode 100644
index b9a29d7..0000000
--- a/debian/patches/upstream_updated-for-compatibility-with-LLVM-10.patch
+++ /dev/null
@@ -1,343 +0,0 @@
-From 30d6a2b64f5a05722fdc5d8e3754dbf13425cd62 Mon Sep 17 00:00:00 2001
-From: Egor Gabov <egor.gabov at waveaccess.ru>
-Date: Thu, 4 Jun 2020 17:10:21 +0300
-Subject: [PATCH] updated for compatibility with LLVM 10
-
-In LLVM 10 llvm::StringRef operator std::string() is marked as explicit.
-In this commit all implicit conversion from llvm::StringRef to
-std::string are changed by explicit.
-Also included header file clang/Basic/FileManager.h in src/MiniDumper
-because without this header, class clang::FileEntry in incomplete class
----
- src/FixItExporter.cpp                                 | 5 +++--
- src/MiniAstDumper.cpp                                 | 1 +
- src/Utils.cpp                                         | 2 +-
- src/checkbase.cpp                                     | 2 +-
- src/checks/detachingbase.cpp                          | 2 +-
- src/checks/level0/qenums.cpp                          | 2 +-
- src/checks/level0/qt-macros.cpp                       | 4 ++--
- src/checks/level0/unused-non-trivial-variable.cpp     | 2 +-
- src/checks/level1/detaching-temporary.cpp             | 2 +-
- src/checks/level1/non-pod-global-static.cpp           | 2 +-
- src/checks/level1/qproperty-without-notify.cpp        | 2 +-
- src/checks/level2/missing-typeinfo.cpp                | 2 +-
- src/checks/level2/old-style-connect.cpp               | 6 +++---
- src/checks/level2/rule-of-three.cpp                   | 2 +-
- src/checks/manuallevel/ifndef-define-typo.cpp         | 6 +++---
- src/checks/manuallevel/qproperty-type-mismatch.cpp    | 2 +-
- src/checks/manuallevel/qrequiredresult-candidates.cpp | 2 +-
- src/checks/manuallevel/qt-keywords.cpp                | 4 ++--
- src/checks/manuallevel/reserve-candidates.cpp         | 3 ++-
- 19 files changed, 28 insertions(+), 25 deletions(-)
-
-diff --git a/src/FixItExporter.cpp b/src/FixItExporter.cpp
-index f3af2e5..44240cf 100644
---- a/src/FixItExporter.cpp
-+++ b/src/FixItExporter.cpp
-@@ -68,7 +68,7 @@ void FixItExporter::BeginSourceFile(const LangOptions &LangOpts, const Preproces
- 
-     const auto id = SourceMgr.getMainFileID();
-     const auto entry = SourceMgr.getFileEntryForID(id);
--    getTuDiag().MainSourceFile = entry->getName();
-+    getTuDiag().MainSourceFile = static_cast<std::string>(entry->getName());
- }
- 
- bool FixItExporter::IncludeInDiagnosticCounts() const
-@@ -89,7 +89,8 @@ tooling::Diagnostic FixItExporter::ConvertDiagnostic(const Diagnostic &Info)
-     // TODO: This returns an empty string: DiagEngine->getDiagnosticIDs()->getWarningOptionForDiag(Info.getID());
-     // HACK: capture it at the end of the message: Message text [check-name]
- 
--    std::string checkName = DiagEngine.getDiagnosticIDs()->getWarningOptionForDiag(Info.getID());
-+    std::string checkName =
-+        static_cast<std::string>(DiagEngine.getDiagnosticIDs()->getWarningOptionForDiag(Info.getID()));
-     std::string messageText;
- 
-     if (checkName.empty()) {
-diff --git a/src/MiniAstDumper.cpp b/src/MiniAstDumper.cpp
-index 4766174..6124e6e 100644
---- a/src/MiniAstDumper.cpp
-+++ b/src/MiniAstDumper.cpp
-@@ -24,6 +24,7 @@
- 
- #include <clang/Frontend/CompilerInstance.h>
- #include <clang/Frontend/FrontendPluginRegistry.h>
-+#include <clang/Basic/FileManager.h>
- 
- using namespace clang;
- using namespace std;
-diff --git a/src/Utils.cpp b/src/Utils.cpp
-index 001ced9..b0812fe 100644
---- a/src/Utils.cpp
-+++ b/src/Utils.cpp
-@@ -878,7 +878,7 @@ string Utils::filenameForLoc(SourceLocation loc, const clang::SourceManager &sm)
-     if (loc.isMacroID())
-         loc = sm.getExpansionLoc(loc);
- 
--    const string filename = sm.getFilename(loc);
-+    const string filename = static_cast<std::string>(sm.getFilename(loc));
-     auto splitted = clazy::splitString(filename, '/');
-     if (splitted.empty())
-         return {};
-diff --git a/src/checkbase.cpp b/src/checkbase.cpp
-index 8b40e19..22a426c 100644
---- a/src/checkbase.cpp
-+++ b/src/checkbase.cpp
-@@ -188,7 +188,7 @@ bool CheckBase::shouldIgnoreFile(SourceLocation loc) const
-     if (!loc.isValid())
-         return true;
- 
--    string filename = sm().getFilename(loc);
-+    string filename = static_cast<std::string>(sm().getFilename(loc));
- 
-     return clazy::any_of(m_filesToIgnore, [filename](const std::string &ignored) {
-         return clazy::contains(filename, ignored);
-diff --git a/src/checks/detachingbase.cpp b/src/checks/detachingbase.cpp
-index 70311f4..1b094ee 100644
---- a/src/checks/detachingbase.cpp
-+++ b/src/checks/detachingbase.cpp
-@@ -57,7 +57,7 @@ bool DetachingBase::isDetachingMethod(CXXMethodDecl *method, DetachingMethodType
- 
-     const std::unordered_map<string, std::vector<StringRef>> &methodsByType = detachingMethodType == DetachingMethod ? clazy::detachingMethods()
-                                                                                                                      : clazy::detachingMethodsWithConstCounterParts();
--    auto it = methodsByType.find(className);
-+    auto it = methodsByType.find(static_cast<std::string>(className));
-     if (it != methodsByType.cend()) {
-         const auto &methods = it->second;
-         if (clazy::contains(methods, clazy::name(method)))
-diff --git a/src/checks/level0/qenums.cpp b/src/checks/level0/qenums.cpp
-index 00075b5..db8910f 100644
---- a/src/checks/level0/qenums.cpp
-+++ b/src/checks/level0/qenums.cpp
-@@ -59,7 +59,7 @@ void QEnums::VisitMacroExpands(const Token &MacroNameTok, const SourceRange &ran
-         // We simply check if :: is present because it's very cumbersome to to check for different classes when dealing with the pre-processor
- 
-         CharSourceRange crange = Lexer::getAsCharRange(range, sm(), lo());
--        string text = Lexer::getSourceText(crange, sm(), lo());
-+        string text = static_cast<std::string>(Lexer::getSourceText(crange, sm(), lo()));
-         if (clazy::contains(text, "::"))
-             return;
-     }
-diff --git a/src/checks/level0/qt-macros.cpp b/src/checks/level0/qt-macros.cpp
-index d3a587c..ab8e9f5 100644
---- a/src/checks/level0/qt-macros.cpp
-+++ b/src/checks/level0/qt-macros.cpp
-@@ -44,7 +44,7 @@ void QtMacros::VisitMacroDefined(const Token &MacroNameTok)
-         return;
- 
-     IdentifierInfo *ii = MacroNameTok.getIdentifierInfo();
--    if (ii && clazy::startsWith(ii->getName(), "Q_OS_"))
-+    if (ii && clazy::startsWith(static_cast<std::string>(ii->getName()), "Q_OS_"))
-         m_OSMacroExists = true;
- }
- 
-@@ -58,7 +58,7 @@ void QtMacros::checkIfDef(const Token &macroNameTok, SourceLocation Loc)
-     if (preProcessorVisitor && preProcessorVisitor->qtVersion() < 51204 && ii->getName() == "Q_OS_WINDOWS") {
-         // Q_OS_WINDOWS was introduced in 5.12.4
-         emitWarning(Loc, "Q_OS_WINDOWS was only introduced in Qt 5.12.4, use Q_OS_WIN instead");
--    } else if (!m_OSMacroExists && clazy::startsWith(ii->getName(), "Q_OS_")) {
-+    } else if (!m_OSMacroExists && clazy::startsWith(static_cast<std::string>(ii->getName()), "Q_OS_")) {
-         emitWarning(Loc, "Include qglobal.h before testing Q_OS_ macros");
-     }
- }
-diff --git a/src/checks/level0/unused-non-trivial-variable.cpp b/src/checks/level0/unused-non-trivial-variable.cpp
-index 4e4b830..93815f2 100644
---- a/src/checks/level0/unused-non-trivial-variable.cpp
-+++ b/src/checks/level0/unused-non-trivial-variable.cpp
-@@ -91,7 +91,7 @@ bool UnusedNonTrivialVariable::isUninterestingType(const CXXRecordDecl *record)
-     static const vector<StringRef> blacklistedTemplates = { "QScopedPointer", "QSetValueOnDestroy", "QScopedValueRollback" };
-     StringRef className = clazy::name(record);
-     for (StringRef templateName : blacklistedTemplates) {
--        if (clazy::startsWith(className, templateName))
-+        if (clazy::startsWith(static_cast<std::string>(className), static_cast<std::string>(templateName)))
-             return true;
-     }
- 
-diff --git a/src/checks/level1/detaching-temporary.cpp b/src/checks/level1/detaching-temporary.cpp
-index fedfc81..60c7553 100644
---- a/src/checks/level1/detaching-temporary.cpp
-+++ b/src/checks/level1/detaching-temporary.cpp
-@@ -140,7 +140,7 @@ void DetachingTemporary::VisitStmt(clang::Stmt *stm)
-     StringRef className = clazy::name(classDecl);
- 
-     const std::unordered_map<string, std::vector<StringRef>> &methodsByType = clazy::detachingMethods();
--    auto it = methodsByType.find(className);
-+    auto it = methodsByType.find(static_cast<std::string>(className));
-     auto it2 = m_writeMethodsByType.find(className);
- 
-     std::vector<StringRef> allowedFunctions;
-diff --git a/src/checks/level1/non-pod-global-static.cpp b/src/checks/level1/non-pod-global-static.cpp
-index 5879bff..433b5c5 100644
---- a/src/checks/level1/non-pod-global-static.cpp
-+++ b/src/checks/level1/non-pod-global-static.cpp
-@@ -74,7 +74,7 @@ void NonPodGlobalStatic::VisitStmt(clang::Stmt *stm)
-     const SourceLocation declStart = clazy::getLocStart(varDecl);
- 
-     if (declStart.isMacroID()) {
--        auto macroName = Lexer::getImmediateMacroName(declStart, sm(), lo());
-+        auto macroName = static_cast<std::string>(Lexer::getImmediateMacroName(declStart, sm(), lo()));
-         if (clazy::startsWithAny(macroName, { "Q_IMPORT_PLUGIN", "Q_CONSTRUCTOR_FUNCTION", "Q_DESTRUCTOR_FUNCTION"})) // Don't warn on these
-             return;
-     }
-diff --git a/src/checks/level1/qproperty-without-notify.cpp b/src/checks/level1/qproperty-without-notify.cpp
-index e1d6db4..3af9fee 100644
---- a/src/checks/level1/qproperty-without-notify.cpp
-+++ b/src/checks/level1/qproperty-without-notify.cpp
-@@ -69,7 +69,7 @@ void QPropertyWithoutNotify::VisitMacroExpands(const clang::Token &MacroNameTok,
-         return;
-     CharSourceRange crange = Lexer::getAsCharRange(range, sm(), lo());
- 
--    string text = Lexer::getSourceText(crange, sm(), lo());
-+    string text = static_cast<std::string>(Lexer::getSourceText(crange, sm(), lo()));
-     if (text.back() == ')')
-         text.pop_back();
- 
-diff --git a/src/checks/level2/missing-typeinfo.cpp b/src/checks/level2/missing-typeinfo.cpp
-index 98df2cd..03b44e0 100644
---- a/src/checks/level2/missing-typeinfo.cpp
-+++ b/src/checks/level2/missing-typeinfo.cpp
-@@ -74,7 +74,7 @@ void MissingTypeInfo::VisitDecl(clang::Decl *decl)
-         if (sm().isInSystemHeader(clazy::getLocStart(record)))
-             return;
- 
--        std::string typeName = clazy::name(record);
-+        std::string typeName = static_cast<std::string>(clazy::name(record));
-         if (typeName == "QPair") // QPair doesn't use Q_DECLARE_TYPEINFO, but rather a explicit QTypeInfo.
-             return;
- 
-diff --git a/src/checks/level2/old-style-connect.cpp b/src/checks/level2/old-style-connect.cpp
-index 0fe68c1..396cb70 100644
---- a/src/checks/level2/old-style-connect.cpp
-+++ b/src/checks/level2/old-style-connect.cpp
-@@ -274,7 +274,7 @@ void OldStyleConnect::VisitMacroExpands(const Token &macroNameTok, const SourceR
-         return;
- 
-     auto charRange = Lexer::getAsCharRange(range, sm(), lo());
--    const string text = Lexer::getSourceText(charRange, sm(), lo());
-+    const string text = static_cast<std::string>(Lexer::getSourceText(charRange, sm(), lo()));
- 
-     static regex rx(R"(Q_PRIVATE_SLOT\s*\((.*)\s*,\s*.*\s+(.*)\(.*)");
-     smatch match;
-@@ -293,7 +293,7 @@ string OldStyleConnect::signalOrSlotNameFromMacro(SourceLocation macroLoc)
-     CharSourceRange expansionRange = clazy::getImmediateExpansionRange(macroLoc, sm());
-     SourceRange range = SourceRange(expansionRange.getBegin(), expansionRange.getEnd());
-     auto charRange = Lexer::getAsCharRange(range, sm(), lo());
--    const string text = Lexer::getSourceText(charRange, sm(), lo());
-+    const string text = static_cast<std::string>(Lexer::getSourceText(charRange, sm(), lo()));
- 
-     static regex rx(R"(\s*(SIGNAL|SLOT)\s*\(\s*(.+)\s*\(.*)");
- 
-@@ -315,7 +315,7 @@ bool OldStyleConnect::isSignalOrSlot(SourceLocation loc, string &macroName) cons
-     if (!loc.isMacroID() || loc.isInvalid())
-         return false;
- 
--    macroName = Lexer::getImmediateMacroName(loc, sm(), lo());
-+    macroName = static_cast<std::string>(Lexer::getImmediateMacroName(loc, sm(), lo()));
-     return macroName == "SIGNAL" || macroName == "SLOT";
- }
- 
-diff --git a/src/checks/level2/rule-of-three.cpp b/src/checks/level2/rule-of-three.cpp
-index 8db55d5..7583fcc 100644
---- a/src/checks/level2/rule-of-three.cpp
-+++ b/src/checks/level2/rule-of-three.cpp
-@@ -140,7 +140,7 @@ void RuleOfThree::VisitDecl(clang::Decl *decl)
- 
-     const string className = record->getNameAsString();
-     const string classQualifiedName = record->getQualifiedNameAsString();
--    const string filename = sm().getFilename(recordStart);
-+    const string filename = static_cast<std::string>(sm().getFilename(recordStart));
-     if (clazy::endsWith(className, "Private") && clazy::endsWithAny(filename, { ".cpp", ".cxx", "_p.h" }))
-         return; // Lots of RAII classes fall into this category. And even Private (d-pointer) classes, warning in that case would just be noise
- 
-diff --git a/src/checks/manuallevel/ifndef-define-typo.cpp b/src/checks/manuallevel/ifndef-define-typo.cpp
-index edb6cdf..e9c50a4 100644
---- a/src/checks/manuallevel/ifndef-define-typo.cpp
-+++ b/src/checks/manuallevel/ifndef-define-typo.cpp
-@@ -44,7 +44,7 @@ void IfndefDefineTypo::VisitMacroDefined(const Token &macroNameTok)
- {
-     if (!m_lastIfndef.empty()) {
-         if (IdentifierInfo *ii = macroNameTok.getIdentifierInfo()) {
--            maybeWarn(ii->getName(), macroNameTok.getLocation());
-+            maybeWarn(static_cast<std::string>(ii->getName()), macroNameTok.getLocation());
-         }
-     }
- }
-@@ -53,7 +53,7 @@ void IfndefDefineTypo::VisitDefined(const Token &macroNameTok, const SourceRange
- {
-     if (!m_lastIfndef.empty()) {
-         if (IdentifierInfo *ii = macroNameTok.getIdentifierInfo()) {
--            maybeWarn(ii->getName(), macroNameTok.getLocation());
-+            maybeWarn(static_cast<std::string>(ii->getName()), macroNameTok.getLocation());
-         }
-     }
- }
-@@ -66,7 +66,7 @@ void IfndefDefineTypo::VisitIfdef(SourceLocation, const Token &)
- void IfndefDefineTypo::VisitIfndef(SourceLocation, const Token &macroNameTok)
- {
-     if (IdentifierInfo *ii = macroNameTok.getIdentifierInfo())
--        m_lastIfndef = ii->getName();
-+        m_lastIfndef = static_cast<std::string>(ii->getName());
- }
- 
- void IfndefDefineTypo::VisitIf(SourceLocation, SourceRange, PPCallbacks::ConditionValueKind)
-diff --git a/src/checks/manuallevel/qproperty-type-mismatch.cpp b/src/checks/manuallevel/qproperty-type-mismatch.cpp
-index f91159c..952d9f1 100644
---- a/src/checks/manuallevel/qproperty-type-mismatch.cpp
-+++ b/src/checks/manuallevel/qproperty-type-mismatch.cpp
-@@ -237,7 +237,7 @@ void QPropertyTypeMismatch::VisitMacroExpands(const clang::Token &MacroNameTok,
- 
-     CharSourceRange crange = Lexer::getAsCharRange(range, sm(), lo());
- 
--    string text = Lexer::getSourceText(crange, sm(), lo());
-+    string text = static_cast<std::string>(Lexer::getSourceText(crange, sm(), lo()));
-     if (!text.empty() && text.back() == ')')
-         text.pop_back();
- 
-diff --git a/src/checks/manuallevel/qrequiredresult-candidates.cpp b/src/checks/manuallevel/qrequiredresult-candidates.cpp
-index 912dbaa..6375bd7 100644
---- a/src/checks/manuallevel/qrequiredresult-candidates.cpp
-+++ b/src/checks/manuallevel/qrequiredresult-candidates.cpp
-@@ -65,7 +65,7 @@ void QRequiredResultCandidates::VisitDecl(clang::Decl *decl)
- 
- 
-     if (returnClass == classDecl) {
--        const std::string methodName = clazy::name(method);
-+        const std::string methodName = static_cast<std::string>(clazy::name(method));
-         if (methodName.empty()) // fixes assert
-             return;
- 
-diff --git a/src/checks/manuallevel/qt-keywords.cpp b/src/checks/manuallevel/qt-keywords.cpp
-index e792e95..b60752c 100644
---- a/src/checks/manuallevel/qt-keywords.cpp
-+++ b/src/checks/manuallevel/qt-keywords.cpp
-@@ -59,12 +59,12 @@ void QtKeywords::VisitMacroExpands(const Token &macroNameTok, const SourceRange
-     }
- 
-     static const vector<StringRef> keywords = { "foreach", "signals", "slots", "emit" };
--    std::string name = ii->getName();
-+    std::string name = static_cast<std::string>(ii->getName());
-     if (!clazy::contains(keywords, name))
-         return;
- 
-     // Make sure the macro is Qt's. It must be defined in Qt's headers, not 3rdparty
--    std::string qtheader = sm().getFilename(sm().getSpellingLoc(minfo->getDefinitionLoc()));
-+    std::string qtheader = static_cast<std::string>(sm().getFilename(sm().getSpellingLoc(minfo->getDefinitionLoc())));
-     if (!clazy::endsWith(qtheader, "qglobal.h") && !clazy::endsWith(qtheader, "qobjectdefs.h"))
-         return;
- 
-diff --git a/src/checks/manuallevel/reserve-candidates.cpp b/src/checks/manuallevel/reserve-candidates.cpp
-index 389cac5..92e4491 100644
---- a/src/checks/manuallevel/reserve-candidates.cpp
-+++ b/src/checks/manuallevel/reserve-candidates.cpp
-@@ -78,7 +78,8 @@ static bool isCandidateMethod(CXXMethodDecl *methodDecl)
-     if (!classDecl)
-         return false;
- 
--    if (!clazy::equalsAny(clazy::name(methodDecl), { "append", "push_back", "push", "operator<<", "operator+=" }))
-+    if (!clazy::equalsAny(static_cast<std::string>(clazy::name(methodDecl)),
-+                 { "append", "push_back", "push", "operator<<", "operator+=" }))
-         return false;
- 
-     if (!clazy::isAReserveClass(classDecl))
--- 
-2.28.0
-



More information about the Neon-commits mailing list