public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/clazy] epel8: Fix build against Clang/LLVM 20
@ 2026-08-14 7:35 Jan Grulich
0 siblings, 0 replies; only message in thread
From: Jan Grulich @ 2026-08-14 7:35 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/clazy
Branch : epel8
Commit : 6f8db9b72483160323820d465ad8706e5bd87f72
Author : Jan Grulich <jgrulich@redhat.com>
Date : 2025-04-09T12:56:41+02:00
Stats : +67/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/clazy/c/6f8db9b72483160323820d465ad8706e5bd87f72?branch=epel8
Log:
Fix build against Clang/LLVM 20
---
diff --git a/clazy-fix-build-with-clang20.patch b/clazy-fix-build-with-clang20.patch
new file mode 100644
index 0000000..bae4a8e
--- /dev/null
+++ b/clazy-fix-build-with-clang20.patch
@@ -0,0 +1,61 @@
+From 9ee9d8595a5bb0e41cd36e61fc56deeeb6816065 Mon Sep 17 00:00:00 2001
+From: Alexander Lohnau <alexander.lohnau@gmx.de>
+Date: Sun, 30 Mar 2025 10:30:18 +0200
+Subject: [PATCH 1/2] Add preprocessor if statement for method that is no
+ longer in clang20
+
+https://invent.kde.org/sdk/clazy/-/issues/27
+
+Test failures need to be adressed separately
+---
+ src/FixItExporter.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/FixItExporter.cpp b/src/FixItExporter.cpp
+index f4c14171..a6edcb25 100644
+--- a/src/FixItExporter.cpp
++++ b/src/FixItExporter.cpp
+@@ -191,7 +191,9 @@ void FixItExporter::Diag(SourceLocation Loc, unsigned DiagID)
+ // clear out any current diagnostic, and let the downstream client
+ // format the diagnostic.
+ DiagEngine.setClient(Client, false);
++#if LLVM_VERSION_MAJOR < 20
+ DiagEngine.Clear();
++#endif
+ DiagEngine.Report(Loc, DiagID);
+ DiagEngine.setClient(this, false);
+ }
+--
+GitLab
+
+
+From eadd5f7cb50a816cb32dc492bb8902736e62eddd Mon Sep 17 00:00:00 2001
+From: Alexander Lohnau <alexander.lohnau@gmx.de>
+Date: Sun, 30 Mar 2025 16:52:03 +0200
+Subject: [PATCH 2/2] use-static-qregularexpression: Adjust to type of variable
+ having changed from xvalue to lvalue in clang20
+
+---
+ src/checks/level0/use-static-qregularexpression.cpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/checks/level0/use-static-qregularexpression.cpp b/src/checks/level0/use-static-qregularexpression.cpp
+index 176a6691..71b1370a 100644
+--- a/src/checks/level0/use-static-qregularexpression.cpp
++++ b/src/checks/level0/use-static-qregularexpression.cpp
+@@ -196,6 +196,12 @@ void UseStaticQRegularExpression::VisitStmt(clang::Stmt *stmt)
+ emitWarning(obj->getBeginLoc(), "Don't create temporary QRegularExpression objects. Use a static QRegularExpression object instead");
+ return;
+ }
++
++ // In clang20, "auto m2 = QRegularExpression("[123]").globalMatch(selectedText);" is apparently an l-value
++ if (auto *temp = dyn_cast<MaterializeTemporaryExpr>(obj); temp && isTemporaryQRegexObj(temp, lo())) {
++ emitWarning(temp->getBeginLoc(), "Don't create temporary QRegularExpression objects. Use a static QRegularExpression object instead");
++ }
++
+ } else if (obj->isXValue()) {
+ // is it a temporary?
+ auto *temp = dyn_cast<MaterializeTemporaryExpr>(obj);
+--
+GitLab
+
diff --git a/clazy.spec b/clazy.spec
index bb42769..9a408af 100644
--- a/clazy.spec
+++ b/clazy.spec
@@ -1,7 +1,7 @@
Name: clazy
Summary: Qt oriented code checker based on clang framework
Version: 1.13
-Release: 2%{?dist}
+Release: 3%{?dist}
License: LGPL-2.0-or-later
URL: https://invent.kde.org/sdk/%{name}
@@ -12,6 +12,8 @@ Source0: https://download.kde.org/stable/%{name}/%{version}/src/%{name}-%
%endif
Patch0: clazy-no-rpath.patch
+# https://invent.kde.org/sdk/clazy/-/merge_requests/176
+Patch1: clazy-fix-build-with-clang20.patch
BuildRequires: cmake
BuildRequires: gcc-c++
@@ -52,6 +54,9 @@ refactoring.
%changelog
+* Wed Apr 09 2025 Jan Grulich <jgrulich@redhat.com> - 1.13-3
+- Fix build against Clang/LLVM 20
+
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-14 7:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-14 7:35 [rpms/clazy] epel8: Fix build against Clang/LLVM 20 Jan Grulich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox