1 |
commit: 3cf0b312d76f313c80a28d1c7d112e03e303d3a2 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Oct 26 10:21:23 2020 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Oct 26 13:55:45 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3cf0b312 |
7 |
|
8 |
dev-util/clazy: Fix build with LLVM-11 |
9 |
|
10 |
Fix HOMEPAGE |
11 |
|
12 |
Closes: https://bugs.gentoo.org/749876 |
13 |
Package-Manager: Portage-3.0.8, Repoman-3.0.2 |
14 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
15 |
|
16 |
.../{clazy-1.7.ebuild => clazy-1.7-r1.ebuild} | 9 +- |
17 |
dev-util/clazy/clazy-1.7.ebuild | 2 +- |
18 |
dev-util/clazy/files/clazy-1.7-llvm11-1.patch | 343 +++++++++++++++++++++ |
19 |
dev-util/clazy/files/clazy-1.7-llvm11-2.patch | 28 ++ |
20 |
4 files changed, 378 insertions(+), 4 deletions(-) |
21 |
|
22 |
diff --git a/dev-util/clazy/clazy-1.7.ebuild b/dev-util/clazy/clazy-1.7-r1.ebuild |
23 |
similarity index 85% |
24 |
copy from dev-util/clazy/clazy-1.7.ebuild |
25 |
copy to dev-util/clazy/clazy-1.7-r1.ebuild |
26 |
index 14f32246c9c..cc5ae5d8eb1 100644 |
27 |
--- a/dev-util/clazy/clazy-1.7.ebuild |
28 |
+++ b/dev-util/clazy/clazy-1.7-r1.ebuild |
29 |
@@ -6,12 +6,12 @@ EAPI=7 |
30 |
inherit cmake |
31 |
|
32 |
DESCRIPTION="Compiler plugin which allows clang to understand Qt semantics" |
33 |
-HOMEPAGE="https://kde.org/applications/development/org.kde.clazy" |
34 |
+HOMEPAGE="https://apps.kde.org/en/clazy" |
35 |
SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz" |
36 |
|
37 |
LICENSE="LGPL-2+" |
38 |
SLOT="0" |
39 |
-KEYWORDS="amd64" |
40 |
+KEYWORDS="~amd64" |
41 |
IUSE="" |
42 |
|
43 |
RDEPEND=" |
44 |
@@ -20,7 +20,10 @@ RDEPEND=" |
45 |
" |
46 |
DEPEND="${RDEPEND}" |
47 |
|
48 |
-PATCHES=( "${FILESDIR}/${P}-gnuinstalldirs.patch" ) |
49 |
+PATCHES=( |
50 |
+ "${FILESDIR}"/${P}-gnuinstalldirs.patch |
51 |
+ "${FILESDIR}"/${P}-llvm11-{1,2}.patch |
52 |
+) |
53 |
|
54 |
src_prepare() { |
55 |
cmake_src_prepare |
56 |
|
57 |
diff --git a/dev-util/clazy/clazy-1.7.ebuild b/dev-util/clazy/clazy-1.7.ebuild |
58 |
index 14f32246c9c..a364a426b70 100644 |
59 |
--- a/dev-util/clazy/clazy-1.7.ebuild |
60 |
+++ b/dev-util/clazy/clazy-1.7.ebuild |
61 |
@@ -6,7 +6,7 @@ EAPI=7 |
62 |
inherit cmake |
63 |
|
64 |
DESCRIPTION="Compiler plugin which allows clang to understand Qt semantics" |
65 |
-HOMEPAGE="https://kde.org/applications/development/org.kde.clazy" |
66 |
+HOMEPAGE="https://apps.kde.org/en/clazy" |
67 |
SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz" |
68 |
|
69 |
LICENSE="LGPL-2+" |
70 |
|
71 |
diff --git a/dev-util/clazy/files/clazy-1.7-llvm11-1.patch b/dev-util/clazy/files/clazy-1.7-llvm11-1.patch |
72 |
new file mode 100644 |
73 |
index 00000000000..7b25b340a5c |
74 |
--- /dev/null |
75 |
+++ b/dev-util/clazy/files/clazy-1.7-llvm11-1.patch |
76 |
@@ -0,0 +1,343 @@ |
77 |
+From 30d6a2b64f5a05722fdc5d8e3754dbf13425cd62 Mon Sep 17 00:00:00 2001 |
78 |
+From: Egor Gabov <egor.gabov@××××××××××.ru> |
79 |
+Date: Thu, 4 Jun 2020 17:10:21 +0300 |
80 |
+Subject: [PATCH] updated for compatibility with LLVM 10 |
81 |
+ |
82 |
+In LLVM 10 llvm::StringRef operator std::string() is marked as explicit. |
83 |
+In this commit all implicit conversion from llvm::StringRef to |
84 |
+std::string are changed by explicit. |
85 |
+Also included header file clang/Basic/FileManager.h in src/MiniDumper |
86 |
+because without this header, class clang::FileEntry in incomplete class |
87 |
+--- |
88 |
+ src/FixItExporter.cpp | 5 +++-- |
89 |
+ src/MiniAstDumper.cpp | 1 + |
90 |
+ src/Utils.cpp | 2 +- |
91 |
+ src/checkbase.cpp | 2 +- |
92 |
+ src/checks/detachingbase.cpp | 2 +- |
93 |
+ src/checks/level0/qenums.cpp | 2 +- |
94 |
+ src/checks/level0/qt-macros.cpp | 4 ++-- |
95 |
+ src/checks/level0/unused-non-trivial-variable.cpp | 2 +- |
96 |
+ src/checks/level1/detaching-temporary.cpp | 2 +- |
97 |
+ src/checks/level1/non-pod-global-static.cpp | 2 +- |
98 |
+ src/checks/level1/qproperty-without-notify.cpp | 2 +- |
99 |
+ src/checks/level2/missing-typeinfo.cpp | 2 +- |
100 |
+ src/checks/level2/old-style-connect.cpp | 6 +++--- |
101 |
+ src/checks/level2/rule-of-three.cpp | 2 +- |
102 |
+ src/checks/manuallevel/ifndef-define-typo.cpp | 6 +++--- |
103 |
+ src/checks/manuallevel/qproperty-type-mismatch.cpp | 2 +- |
104 |
+ src/checks/manuallevel/qrequiredresult-candidates.cpp | 2 +- |
105 |
+ src/checks/manuallevel/qt-keywords.cpp | 4 ++-- |
106 |
+ src/checks/manuallevel/reserve-candidates.cpp | 3 ++- |
107 |
+ 19 files changed, 28 insertions(+), 25 deletions(-) |
108 |
+ |
109 |
+diff --git a/src/FixItExporter.cpp b/src/FixItExporter.cpp |
110 |
+index f3af2e5..44240cf 100644 |
111 |
+--- a/src/FixItExporter.cpp |
112 |
++++ b/src/FixItExporter.cpp |
113 |
+@@ -68,7 +68,7 @@ void FixItExporter::BeginSourceFile(const LangOptions &LangOpts, const Preproces |
114 |
+ |
115 |
+ const auto id = SourceMgr.getMainFileID(); |
116 |
+ const auto entry = SourceMgr.getFileEntryForID(id); |
117 |
+- getTuDiag().MainSourceFile = entry->getName(); |
118 |
++ getTuDiag().MainSourceFile = static_cast<std::string>(entry->getName()); |
119 |
+ } |
120 |
+ |
121 |
+ bool FixItExporter::IncludeInDiagnosticCounts() const |
122 |
+@@ -89,7 +89,8 @@ tooling::Diagnostic FixItExporter::ConvertDiagnostic(const Diagnostic &Info) |
123 |
+ // TODO: This returns an empty string: DiagEngine->getDiagnosticIDs()->getWarningOptionForDiag(Info.getID()); |
124 |
+ // HACK: capture it at the end of the message: Message text [check-name] |
125 |
+ |
126 |
+- std::string checkName = DiagEngine.getDiagnosticIDs()->getWarningOptionForDiag(Info.getID()); |
127 |
++ std::string checkName = |
128 |
++ static_cast<std::string>(DiagEngine.getDiagnosticIDs()->getWarningOptionForDiag(Info.getID())); |
129 |
+ std::string messageText; |
130 |
+ |
131 |
+ if (checkName.empty()) { |
132 |
+diff --git a/src/MiniAstDumper.cpp b/src/MiniAstDumper.cpp |
133 |
+index 4766174..6124e6e 100644 |
134 |
+--- a/src/MiniAstDumper.cpp |
135 |
++++ b/src/MiniAstDumper.cpp |
136 |
+@@ -24,6 +24,7 @@ |
137 |
+ |
138 |
+ #include <clang/Frontend/CompilerInstance.h> |
139 |
+ #include <clang/Frontend/FrontendPluginRegistry.h> |
140 |
++#include <clang/Basic/FileManager.h> |
141 |
+ |
142 |
+ using namespace clang; |
143 |
+ using namespace std; |
144 |
+diff --git a/src/Utils.cpp b/src/Utils.cpp |
145 |
+index 001ced9..b0812fe 100644 |
146 |
+--- a/src/Utils.cpp |
147 |
++++ b/src/Utils.cpp |
148 |
+@@ -878,7 +878,7 @@ string Utils::filenameForLoc(SourceLocation loc, const clang::SourceManager &sm) |
149 |
+ if (loc.isMacroID()) |
150 |
+ loc = sm.getExpansionLoc(loc); |
151 |
+ |
152 |
+- const string filename = sm.getFilename(loc); |
153 |
++ const string filename = static_cast<std::string>(sm.getFilename(loc)); |
154 |
+ auto splitted = clazy::splitString(filename, '/'); |
155 |
+ if (splitted.empty()) |
156 |
+ return {}; |
157 |
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp |
158 |
+index 8b40e19..22a426c 100644 |
159 |
+--- a/src/checkbase.cpp |
160 |
++++ b/src/checkbase.cpp |
161 |
+@@ -188,7 +188,7 @@ bool CheckBase::shouldIgnoreFile(SourceLocation loc) const |
162 |
+ if (!loc.isValid()) |
163 |
+ return true; |
164 |
+ |
165 |
+- string filename = sm().getFilename(loc); |
166 |
++ string filename = static_cast<std::string>(sm().getFilename(loc)); |
167 |
+ |
168 |
+ return clazy::any_of(m_filesToIgnore, [filename](const std::string &ignored) { |
169 |
+ return clazy::contains(filename, ignored); |
170 |
+diff --git a/src/checks/detachingbase.cpp b/src/checks/detachingbase.cpp |
171 |
+index 70311f4..1b094ee 100644 |
172 |
+--- a/src/checks/detachingbase.cpp |
173 |
++++ b/src/checks/detachingbase.cpp |
174 |
+@@ -57,7 +57,7 @@ bool DetachingBase::isDetachingMethod(CXXMethodDecl *method, DetachingMethodType |
175 |
+ |
176 |
+ const std::unordered_map<string, std::vector<StringRef>> &methodsByType = detachingMethodType == DetachingMethod ? clazy::detachingMethods() |
177 |
+ : clazy::detachingMethodsWithConstCounterParts(); |
178 |
+- auto it = methodsByType.find(className); |
179 |
++ auto it = methodsByType.find(static_cast<std::string>(className)); |
180 |
+ if (it != methodsByType.cend()) { |
181 |
+ const auto &methods = it->second; |
182 |
+ if (clazy::contains(methods, clazy::name(method))) |
183 |
+diff --git a/src/checks/level0/qenums.cpp b/src/checks/level0/qenums.cpp |
184 |
+index 00075b5..db8910f 100644 |
185 |
+--- a/src/checks/level0/qenums.cpp |
186 |
++++ b/src/checks/level0/qenums.cpp |
187 |
+@@ -59,7 +59,7 @@ void QEnums::VisitMacroExpands(const Token &MacroNameTok, const SourceRange &ran |
188 |
+ // We simply check if :: is present because it's very cumbersome to to check for different classes when dealing with the pre-processor |
189 |
+ |
190 |
+ CharSourceRange crange = Lexer::getAsCharRange(range, sm(), lo()); |
191 |
+- string text = Lexer::getSourceText(crange, sm(), lo()); |
192 |
++ string text = static_cast<std::string>(Lexer::getSourceText(crange, sm(), lo())); |
193 |
+ if (clazy::contains(text, "::")) |
194 |
+ return; |
195 |
+ } |
196 |
+diff --git a/src/checks/level0/qt-macros.cpp b/src/checks/level0/qt-macros.cpp |
197 |
+index d3a587c..ab8e9f5 100644 |
198 |
+--- a/src/checks/level0/qt-macros.cpp |
199 |
++++ b/src/checks/level0/qt-macros.cpp |
200 |
+@@ -44,7 +44,7 @@ void QtMacros::VisitMacroDefined(const Token &MacroNameTok) |
201 |
+ return; |
202 |
+ |
203 |
+ IdentifierInfo *ii = MacroNameTok.getIdentifierInfo(); |
204 |
+- if (ii && clazy::startsWith(ii->getName(), "Q_OS_")) |
205 |
++ if (ii && clazy::startsWith(static_cast<std::string>(ii->getName()), "Q_OS_")) |
206 |
+ m_OSMacroExists = true; |
207 |
+ } |
208 |
+ |
209 |
+@@ -58,7 +58,7 @@ void QtMacros::checkIfDef(const Token ¯oNameTok, SourceLocation Loc) |
210 |
+ if (preProcessorVisitor && preProcessorVisitor->qtVersion() < 51204 && ii->getName() == "Q_OS_WINDOWS") { |
211 |
+ // Q_OS_WINDOWS was introduced in 5.12.4 |
212 |
+ emitWarning(Loc, "Q_OS_WINDOWS was only introduced in Qt 5.12.4, use Q_OS_WIN instead"); |
213 |
+- } else if (!m_OSMacroExists && clazy::startsWith(ii->getName(), "Q_OS_")) { |
214 |
++ } else if (!m_OSMacroExists && clazy::startsWith(static_cast<std::string>(ii->getName()), "Q_OS_")) { |
215 |
+ emitWarning(Loc, "Include qglobal.h before testing Q_OS_ macros"); |
216 |
+ } |
217 |
+ } |
218 |
+diff --git a/src/checks/level0/unused-non-trivial-variable.cpp b/src/checks/level0/unused-non-trivial-variable.cpp |
219 |
+index 4e4b830..93815f2 100644 |
220 |
+--- a/src/checks/level0/unused-non-trivial-variable.cpp |
221 |
++++ b/src/checks/level0/unused-non-trivial-variable.cpp |
222 |
+@@ -91,7 +91,7 @@ bool UnusedNonTrivialVariable::isUninterestingType(const CXXRecordDecl *record) |
223 |
+ static const vector<StringRef> blacklistedTemplates = { "QScopedPointer", "QSetValueOnDestroy", "QScopedValueRollback" }; |
224 |
+ StringRef className = clazy::name(record); |
225 |
+ for (StringRef templateName : blacklistedTemplates) { |
226 |
+- if (clazy::startsWith(className, templateName)) |
227 |
++ if (clazy::startsWith(static_cast<std::string>(className), static_cast<std::string>(templateName))) |
228 |
+ return true; |
229 |
+ } |
230 |
+ |
231 |
+diff --git a/src/checks/level1/detaching-temporary.cpp b/src/checks/level1/detaching-temporary.cpp |
232 |
+index fedfc81..60c7553 100644 |
233 |
+--- a/src/checks/level1/detaching-temporary.cpp |
234 |
++++ b/src/checks/level1/detaching-temporary.cpp |
235 |
+@@ -140,7 +140,7 @@ void DetachingTemporary::VisitStmt(clang::Stmt *stm) |
236 |
+ StringRef className = clazy::name(classDecl); |
237 |
+ |
238 |
+ const std::unordered_map<string, std::vector<StringRef>> &methodsByType = clazy::detachingMethods(); |
239 |
+- auto it = methodsByType.find(className); |
240 |
++ auto it = methodsByType.find(static_cast<std::string>(className)); |
241 |
+ auto it2 = m_writeMethodsByType.find(className); |
242 |
+ |
243 |
+ std::vector<StringRef> allowedFunctions; |
244 |
+diff --git a/src/checks/level1/non-pod-global-static.cpp b/src/checks/level1/non-pod-global-static.cpp |
245 |
+index 5879bff..433b5c5 100644 |
246 |
+--- a/src/checks/level1/non-pod-global-static.cpp |
247 |
++++ b/src/checks/level1/non-pod-global-static.cpp |
248 |
+@@ -74,7 +74,7 @@ void NonPodGlobalStatic::VisitStmt(clang::Stmt *stm) |
249 |
+ const SourceLocation declStart = clazy::getLocStart(varDecl); |
250 |
+ |
251 |
+ if (declStart.isMacroID()) { |
252 |
+- auto macroName = Lexer::getImmediateMacroName(declStart, sm(), lo()); |
253 |
++ auto macroName = static_cast<std::string>(Lexer::getImmediateMacroName(declStart, sm(), lo())); |
254 |
+ if (clazy::startsWithAny(macroName, { "Q_IMPORT_PLUGIN", "Q_CONSTRUCTOR_FUNCTION", "Q_DESTRUCTOR_FUNCTION"})) // Don't warn on these |
255 |
+ return; |
256 |
+ } |
257 |
+diff --git a/src/checks/level1/qproperty-without-notify.cpp b/src/checks/level1/qproperty-without-notify.cpp |
258 |
+index e1d6db4..3af9fee 100644 |
259 |
+--- a/src/checks/level1/qproperty-without-notify.cpp |
260 |
++++ b/src/checks/level1/qproperty-without-notify.cpp |
261 |
+@@ -69,7 +69,7 @@ void QPropertyWithoutNotify::VisitMacroExpands(const clang::Token &MacroNameTok, |
262 |
+ return; |
263 |
+ CharSourceRange crange = Lexer::getAsCharRange(range, sm(), lo()); |
264 |
+ |
265 |
+- string text = Lexer::getSourceText(crange, sm(), lo()); |
266 |
++ string text = static_cast<std::string>(Lexer::getSourceText(crange, sm(), lo())); |
267 |
+ if (text.back() == ')') |
268 |
+ text.pop_back(); |
269 |
+ |
270 |
+diff --git a/src/checks/level2/missing-typeinfo.cpp b/src/checks/level2/missing-typeinfo.cpp |
271 |
+index 98df2cd..03b44e0 100644 |
272 |
+--- a/src/checks/level2/missing-typeinfo.cpp |
273 |
++++ b/src/checks/level2/missing-typeinfo.cpp |
274 |
+@@ -74,7 +74,7 @@ void MissingTypeInfo::VisitDecl(clang::Decl *decl) |
275 |
+ if (sm().isInSystemHeader(clazy::getLocStart(record))) |
276 |
+ return; |
277 |
+ |
278 |
+- std::string typeName = clazy::name(record); |
279 |
++ std::string typeName = static_cast<std::string>(clazy::name(record)); |
280 |
+ if (typeName == "QPair") // QPair doesn't use Q_DECLARE_TYPEINFO, but rather a explicit QTypeInfo. |
281 |
+ return; |
282 |
+ |
283 |
+diff --git a/src/checks/level2/old-style-connect.cpp b/src/checks/level2/old-style-connect.cpp |
284 |
+index 0fe68c1..396cb70 100644 |
285 |
+--- a/src/checks/level2/old-style-connect.cpp |
286 |
++++ b/src/checks/level2/old-style-connect.cpp |
287 |
+@@ -274,7 +274,7 @@ void OldStyleConnect::VisitMacroExpands(const Token ¯oNameTok, const SourceR |
288 |
+ return; |
289 |
+ |
290 |
+ auto charRange = Lexer::getAsCharRange(range, sm(), lo()); |
291 |
+- const string text = Lexer::getSourceText(charRange, sm(), lo()); |
292 |
++ const string text = static_cast<std::string>(Lexer::getSourceText(charRange, sm(), lo())); |
293 |
+ |
294 |
+ static regex rx(R"(Q_PRIVATE_SLOT\s*\((.*)\s*,\s*.*\s+(.*)\(.*)"); |
295 |
+ smatch match; |
296 |
+@@ -293,7 +293,7 @@ string OldStyleConnect::signalOrSlotNameFromMacro(SourceLocation macroLoc) |
297 |
+ CharSourceRange expansionRange = clazy::getImmediateExpansionRange(macroLoc, sm()); |
298 |
+ SourceRange range = SourceRange(expansionRange.getBegin(), expansionRange.getEnd()); |
299 |
+ auto charRange = Lexer::getAsCharRange(range, sm(), lo()); |
300 |
+- const string text = Lexer::getSourceText(charRange, sm(), lo()); |
301 |
++ const string text = static_cast<std::string>(Lexer::getSourceText(charRange, sm(), lo())); |
302 |
+ |
303 |
+ static regex rx(R"(\s*(SIGNAL|SLOT)\s*\(\s*(.+)\s*\(.*)"); |
304 |
+ |
305 |
+@@ -315,7 +315,7 @@ bool OldStyleConnect::isSignalOrSlot(SourceLocation loc, string ¯oName) cons |
306 |
+ if (!loc.isMacroID() || loc.isInvalid()) |
307 |
+ return false; |
308 |
+ |
309 |
+- macroName = Lexer::getImmediateMacroName(loc, sm(), lo()); |
310 |
++ macroName = static_cast<std::string>(Lexer::getImmediateMacroName(loc, sm(), lo())); |
311 |
+ return macroName == "SIGNAL" || macroName == "SLOT"; |
312 |
+ } |
313 |
+ |
314 |
+diff --git a/src/checks/level2/rule-of-three.cpp b/src/checks/level2/rule-of-three.cpp |
315 |
+index 8db55d5..7583fcc 100644 |
316 |
+--- a/src/checks/level2/rule-of-three.cpp |
317 |
++++ b/src/checks/level2/rule-of-three.cpp |
318 |
+@@ -140,7 +140,7 @@ void RuleOfThree::VisitDecl(clang::Decl *decl) |
319 |
+ |
320 |
+ const string className = record->getNameAsString(); |
321 |
+ const string classQualifiedName = record->getQualifiedNameAsString(); |
322 |
+- const string filename = sm().getFilename(recordStart); |
323 |
++ const string filename = static_cast<std::string>(sm().getFilename(recordStart)); |
324 |
+ if (clazy::endsWith(className, "Private") && clazy::endsWithAny(filename, { ".cpp", ".cxx", "_p.h" })) |
325 |
+ return; // Lots of RAII classes fall into this category. And even Private (d-pointer) classes, warning in that case would just be noise |
326 |
+ |
327 |
+diff --git a/src/checks/manuallevel/ifndef-define-typo.cpp b/src/checks/manuallevel/ifndef-define-typo.cpp |
328 |
+index edb6cdf..e9c50a4 100644 |
329 |
+--- a/src/checks/manuallevel/ifndef-define-typo.cpp |
330 |
++++ b/src/checks/manuallevel/ifndef-define-typo.cpp |
331 |
+@@ -44,7 +44,7 @@ void IfndefDefineTypo::VisitMacroDefined(const Token ¯oNameTok) |
332 |
+ { |
333 |
+ if (!m_lastIfndef.empty()) { |
334 |
+ if (IdentifierInfo *ii = macroNameTok.getIdentifierInfo()) { |
335 |
+- maybeWarn(ii->getName(), macroNameTok.getLocation()); |
336 |
++ maybeWarn(static_cast<std::string>(ii->getName()), macroNameTok.getLocation()); |
337 |
+ } |
338 |
+ } |
339 |
+ } |
340 |
+@@ -53,7 +53,7 @@ void IfndefDefineTypo::VisitDefined(const Token ¯oNameTok, const SourceRange |
341 |
+ { |
342 |
+ if (!m_lastIfndef.empty()) { |
343 |
+ if (IdentifierInfo *ii = macroNameTok.getIdentifierInfo()) { |
344 |
+- maybeWarn(ii->getName(), macroNameTok.getLocation()); |
345 |
++ maybeWarn(static_cast<std::string>(ii->getName()), macroNameTok.getLocation()); |
346 |
+ } |
347 |
+ } |
348 |
+ } |
349 |
+@@ -66,7 +66,7 @@ void IfndefDefineTypo::VisitIfdef(SourceLocation, const Token &) |
350 |
+ void IfndefDefineTypo::VisitIfndef(SourceLocation, const Token ¯oNameTok) |
351 |
+ { |
352 |
+ if (IdentifierInfo *ii = macroNameTok.getIdentifierInfo()) |
353 |
+- m_lastIfndef = ii->getName(); |
354 |
++ m_lastIfndef = static_cast<std::string>(ii->getName()); |
355 |
+ } |
356 |
+ |
357 |
+ void IfndefDefineTypo::VisitIf(SourceLocation, SourceRange, PPCallbacks::ConditionValueKind) |
358 |
+diff --git a/src/checks/manuallevel/qproperty-type-mismatch.cpp b/src/checks/manuallevel/qproperty-type-mismatch.cpp |
359 |
+index f91159c..952d9f1 100644 |
360 |
+--- a/src/checks/manuallevel/qproperty-type-mismatch.cpp |
361 |
++++ b/src/checks/manuallevel/qproperty-type-mismatch.cpp |
362 |
+@@ -237,7 +237,7 @@ void QPropertyTypeMismatch::VisitMacroExpands(const clang::Token &MacroNameTok, |
363 |
+ |
364 |
+ CharSourceRange crange = Lexer::getAsCharRange(range, sm(), lo()); |
365 |
+ |
366 |
+- string text = Lexer::getSourceText(crange, sm(), lo()); |
367 |
++ string text = static_cast<std::string>(Lexer::getSourceText(crange, sm(), lo())); |
368 |
+ if (!text.empty() && text.back() == ')') |
369 |
+ text.pop_back(); |
370 |
+ |
371 |
+diff --git a/src/checks/manuallevel/qrequiredresult-candidates.cpp b/src/checks/manuallevel/qrequiredresult-candidates.cpp |
372 |
+index 912dbaa..6375bd7 100644 |
373 |
+--- a/src/checks/manuallevel/qrequiredresult-candidates.cpp |
374 |
++++ b/src/checks/manuallevel/qrequiredresult-candidates.cpp |
375 |
+@@ -65,7 +65,7 @@ void QRequiredResultCandidates::VisitDecl(clang::Decl *decl) |
376 |
+ |
377 |
+ |
378 |
+ if (returnClass == classDecl) { |
379 |
+- const std::string methodName = clazy::name(method); |
380 |
++ const std::string methodName = static_cast<std::string>(clazy::name(method)); |
381 |
+ if (methodName.empty()) // fixes assert |
382 |
+ return; |
383 |
+ |
384 |
+diff --git a/src/checks/manuallevel/qt-keywords.cpp b/src/checks/manuallevel/qt-keywords.cpp |
385 |
+index e792e95..b60752c 100644 |
386 |
+--- a/src/checks/manuallevel/qt-keywords.cpp |
387 |
++++ b/src/checks/manuallevel/qt-keywords.cpp |
388 |
+@@ -59,12 +59,12 @@ void QtKeywords::VisitMacroExpands(const Token ¯oNameTok, const SourceRange |
389 |
+ } |
390 |
+ |
391 |
+ static const vector<StringRef> keywords = { "foreach", "signals", "slots", "emit" }; |
392 |
+- std::string name = ii->getName(); |
393 |
++ std::string name = static_cast<std::string>(ii->getName()); |
394 |
+ if (!clazy::contains(keywords, name)) |
395 |
+ return; |
396 |
+ |
397 |
+ // Make sure the macro is Qt's. It must be defined in Qt's headers, not 3rdparty |
398 |
+- std::string qtheader = sm().getFilename(sm().getSpellingLoc(minfo->getDefinitionLoc())); |
399 |
++ std::string qtheader = static_cast<std::string>(sm().getFilename(sm().getSpellingLoc(minfo->getDefinitionLoc()))); |
400 |
+ if (!clazy::endsWith(qtheader, "qglobal.h") && !clazy::endsWith(qtheader, "qobjectdefs.h")) |
401 |
+ return; |
402 |
+ |
403 |
+diff --git a/src/checks/manuallevel/reserve-candidates.cpp b/src/checks/manuallevel/reserve-candidates.cpp |
404 |
+index 389cac5..92e4491 100644 |
405 |
+--- a/src/checks/manuallevel/reserve-candidates.cpp |
406 |
++++ b/src/checks/manuallevel/reserve-candidates.cpp |
407 |
+@@ -78,7 +78,8 @@ static bool isCandidateMethod(CXXMethodDecl *methodDecl) |
408 |
+ if (!classDecl) |
409 |
+ return false; |
410 |
+ |
411 |
+- if (!clazy::equalsAny(clazy::name(methodDecl), { "append", "push_back", "push", "operator<<", "operator+=" })) |
412 |
++ if (!clazy::equalsAny(static_cast<std::string>(clazy::name(methodDecl)), |
413 |
++ { "append", "push_back", "push", "operator<<", "operator+=" })) |
414 |
+ return false; |
415 |
+ |
416 |
+ if (!clazy::isAReserveClass(classDecl)) |
417 |
+-- |
418 |
+GitLab |
419 |
+ |
420 |
|
421 |
diff --git a/dev-util/clazy/files/clazy-1.7-llvm11-2.patch b/dev-util/clazy/files/clazy-1.7-llvm11-2.patch |
422 |
new file mode 100644 |
423 |
index 00000000000..4556f257bf3 |
424 |
--- /dev/null |
425 |
+++ b/dev-util/clazy/files/clazy-1.7-llvm11-2.patch |
426 |
@@ -0,0 +1,28 @@ |
427 |
+From 25aa102cc49def9573ffbed88155589cd60a2e8f Mon Sep 17 00:00:00 2001 |
428 |
+From: Egor Gabov <egor.gabov@××××××××××.ru> |
429 |
+Date: Fri, 5 Jun 2020 16:52:53 +0300 |
430 |
+Subject: [PATCH] updated for compatibility with LLVM 10 (clazy-standalone) |
431 |
+ |
432 |
+In LLVM 10 llvm::StringRef operator std::string() is marked as explicit. |
433 |
+In this commit all implicit conversion from llvm::StringRef to |
434 |
+std::string are changed by explicit. |
435 |
+--- |
436 |
+ src/checks/manuallevel/jnisignatures.cpp | 2 +- |
437 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
438 |
+ |
439 |
+diff --git a/src/checks/manuallevel/jnisignatures.cpp b/src/checks/manuallevel/jnisignatures.cpp |
440 |
+index 81e61d4..5d4fe20 100644 |
441 |
+--- a/src/checks/manuallevel/jnisignatures.cpp |
442 |
++++ b/src/checks/manuallevel/jnisignatures.cpp |
443 |
+@@ -103,7 +103,7 @@ void JniSignatures::checkFunctionCall(Stmt *stm) |
444 |
+ return; |
445 |
+ } |
446 |
+ |
447 |
+- const std::string name = clazy::name(funDecl); |
448 |
++ const std::string name = static_cast<std::string>(clazy::name(funDecl)); |
449 |
+ |
450 |
+ if (name == "callObjectMethod" || name == "callMethod") { |
451 |
+ checkArgAt(callExpr, 0, methodNameRegex, "Invalid method name"); |
452 |
+-- |
453 |
+GitLab |
454 |
+ |