public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jan Grulich <jgrulich@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/clazy] epel8: Fix build against Clang/LLVM 20
Date: Fri, 14 Aug 2026 07:35:59 GMT	[thread overview]
Message-ID: <178669295997.1.9710334120111791542.rpms-clazy-6f8db9b72483@fedoraproject.org> (raw)

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
 

                 reply	other threads:[~2026-08-14  7:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178669295997.1.9710334120111791542.rpms-clazy-6f8db9b72483@fedoraproject.org \
    --to=jgrulich@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox