From f3aabe7ed51ab50be18a9a41b177cc488f4f7f5b Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Fri, 15 Nov 2024 09:21:34 +0100 Subject: [PATCH] qproperty_p.h: fix -Wshadow in notify() Clang warning: .../qproperty_p.h:666:58: warning: declaration shadows a local variable [-Wshadow] 666 | if (QPropertyObserverPointer observer = d.firstObserver()) | ^ .../qproperty_p.h:660:46: note: previous declaration is here 660 | if (QPropertyObserverPointer observer = d.firstObserver()) { | Fix by abbreviating the variable name in if statement. Change-Id: I7905de08f15124466f8aa587691b2880c889199f Reviewed-by: Ulf Hermann (cherry picked from commit 2fc5735f60e0bcd7b7b451a32fd999f2d36a33c8) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/kernel/qproperty_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qproperty_p.h b/src/corelib/kernel/qproperty_p.h index 2ecba93302e..8ef26babc00 100644 --- a/src/corelib/kernel/qproperty_p.h +++ b/src/corelib/kernel/qproperty_p.h @@ -663,8 +663,8 @@ public: if (bd->notifyObserver_helper(this, storage, observer, bindingObservers) == QtPrivate::QPropertyBindingData::Evaluated) { // evaluateBindings() can trash the observers. We need to re-fetch here. - if (QPropertyObserverPointer observer = d.firstObserver()) - observer.notify(this); + if (QPropertyObserverPointer obs = d.firstObserver()) + obs.notify(this); for (auto&& bindingPtr: bindingObservers) { auto *binding = static_cast(bindingPtr.get()); binding->notifyNonRecursive();