File 0001-Rename-variable-being-shadowed.patch of Package qt6-base
From 282a959ed771e5598a4d1d4e9d6c1a5a2d5e6286 Mon Sep 17 00:00:00 2001
From: Antonio Larrosa <larrosa@kde.org>
Date: Wed, 9 Apr 2025 08:02:06 +0200
Subject: [PATCH] Rename variable being shadowed
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Otherwise building any application that includes this header while using -Werror=shadow fails with:
[ 89s] /usr/include/qt6/QtCore/qtmochelpers.h:563:36: in ‘constexpr’ expansion of ‘(& methods)->QtMocHelpers::UintData<QtMocHelpers::SignalData<void(libcamera::FrameBuffer*)> >::copyTo<{anonymous}::qt_meta_tag_ZN12ViewFinderGLE_t, QtMocHelpers::MetaObjectContents<24, 10, 60, 3> >(result, ((size_t)dataoffset), metatypeoffset)’
[ 89s] /usr/include/qt6/QtCore/qtmochelpers.h:201:57: error: declaration of ‘entry’ shadows a member of ‘QtMocHelpers::detail::UintDataStorage<std::integer_sequence<int, 0>, QtMocHelpers::SignalData<void(libcamera::FrameBuffer*)> >’ [-Werror=shadow]
[ 89s] 201 | [[maybe_unused]] auto invoke = [&f](const auto &entry) { f(entry.entry); return 0; };
[ 89s] | ~~~~~~~~~~~~^~~~~
[ 89s] /usr/include/qt6/QtCore/qtmochelpers.h:180:7: note: shadowed declaration is here
[ 89s] 180 | T entry;
[ 89s] | ^~~~~
[ 89s] cc1plus: all warnings being treated as errors
Change-Id: I7a3e48fc98acbfabf611b6be813b8576c7168499
---
src/corelib/kernel/qtmochelpers.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/corelib/kernel/qtmochelpers.h b/src/corelib/kernel/qtmochelpers.h
index 3099389b872..4c549e78ad5 100644
--- a/src/corelib/kernel/qtmochelpers.h
+++ b/src/corelib/kernel/qtmochelpers.h
@@ -198,7 +198,7 @@ template <int... Idx, typename... T> struct UintDataStorage<std::integer_sequenc
template <typename F> constexpr void forEach(F &&f) const
{
- [[maybe_unused]] auto invoke = [&f](const auto &entry) { f(entry.entry); return 0; };
+ [[maybe_unused]] auto invoke = [&f](const auto &entry_) { f(entry_.entry); return 0; };
int dummy[] = {
0,
invoke(static_cast<const UintDataEntry<Idx, T> &>(*this))...
--
2.49.0