commit:     96eea9e2637ed2475e44a8cb9c18e22edafd7162
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Thu Aug 28 03:48:50 2025 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Thu Aug 28 04:52:09 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96eea9e2

dev-qt/qtwebengine: fix clang-21

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/43590
Closes: https://github.com/gentoo/gentoo/pull/43590
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../files/qtwebengine-6.9.2-clang-21.patch         | 42 ++++++++++++++++++++++
 dev-qt/qtwebengine/qtwebengine-6.9.2.ebuild        |  1 +
 2 files changed, 43 insertions(+)

diff --git a/dev-qt/qtwebengine/files/qtwebengine-6.9.2-clang-21.patch 
b/dev-qt/qtwebengine/files/qtwebengine-6.9.2-clang-21.patch
new file mode 100644
index 000000000000..374ee195dafe
--- /dev/null
+++ b/dev-qt/qtwebengine/files/qtwebengine-6.9.2-clang-21.patch
@@ -0,0 +1,42 @@
+https://issues.chromium.org/issues/423841920
+https://chromium-review.googlesource.com/c/chromium/src/+/6633292
+
+From b0ff8c3b258a8816c05bdebf472dbba719d3c491 Mon Sep 17 00:00:00 2001
+From: Hans Wennborg <[email protected]>
+Date: Tue, 10 Jun 2025 09:51:47 -0700
+Subject: [PATCH] Don't return an enum from EnumSizeTraits::Count
+
+`Enum::kMaxValue + 1` may be outside the representable range of the
+enum, which Clang will treat as an error in constexpr contexts (see
+bug).
+
+Bug: 423841920
+Change-Id: I629402cf93bd8419a71f94ff9ed9340d4f88a706
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6633292
+Auto-Submit: Hans Wennborg <[email protected]>
+Commit-Queue: Nico Weber <[email protected]>
+Reviewed-by: Nico Weber <[email protected]>
+Commit-Queue: Hans Wennborg <[email protected]>
+Cr-Commit-Position: refs/heads/main@{#1471871}
+--- a/src/3rdparty/chromium/base/metrics/histogram_macros_internal.h
++++ b/src/3rdparty/chromium/base/metrics/histogram_macros_internal.h
+@@ -28,16 +28,16 @@
+ template <typename Enum>
+   requires(std::is_enum_v<Enum>)
+ struct EnumSizeTraits {
+-  static constexpr Enum Count() {
++  static constexpr uintmax_t Count() {
+     if constexpr (requires { Enum::kMaxValue; }) {
+       // Since the UMA histogram macros expect a value one larger than the max
+       // defined enumerator value, add one.
+-      return static_cast<Enum>(base::to_underlying(Enum::kMaxValue) + 1);
++      return static_cast<uintmax_t>(base::to_underlying(Enum::kMaxValue) + 1);
+     } else {
+       static_assert(
+           sizeof(Enum) == 0,
+           "enumerator must define kMaxValue enumerator to use this macro!");
+-      return Enum();
++      return 0;
+     }
+   }
+ };

diff --git a/dev-qt/qtwebengine/qtwebengine-6.9.2.ebuild 
b/dev-qt/qtwebengine/qtwebengine-6.9.2.ebuild
index f3874d0b4c9e..aea5cf9df06d 100644
--- a/dev-qt/qtwebengine/qtwebengine-6.9.2.ebuild
+++ b/dev-qt/qtwebengine/qtwebengine-6.9.2.ebuild
@@ -108,6 +108,7 @@ PATCHES=( "${WORKDIR}"/patches/${PN} )
 
 PATCHES+=(
        # add extras as needed here, may merge in set if carries across versions
+       "${FILESDIR}"/qtwebengine-6.9.2-clang-21.patch
 )
 
 python_check_deps() {

Reply via email to