From 3efd5950f3374a6eba3ec172c839d434aefd27af Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 12 Sep 2024 16:38:12 +0200 Subject: [PATCH] QPropertyBindingPrivate: fix -Wshadow in sourceLocation() This is preparation of applying headercheck to private headers, too. Renaming the returned value to `result` also obsoletes the need for the ugly this-> qualification, otherwise easily misread for a compiler hint to look up the name in a template base class (which here does not exist). Amends 4d579851c842e136fbaf7a5d629c249456a91e39. Pick-to: 6.7 6.5 6.2 Task-number: QTBUG-126219 Change-Id: Ib683f3deec492acdd2bc61806a8b0467f18f0fe8 Reviewed-by: Ulf Hermann (cherry picked from commit 5cd3fec9f9a2bca8c27bdee6b185714983b5d11e) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/kernel/qproperty_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/kernel/qproperty_p.h b/src/corelib/kernel/qproperty_p.h index b2059229d20..e6e1dec2c2a 100644 --- a/src/corelib/kernel/qproperty_p.h +++ b/src/corelib/kernel/qproperty_p.h @@ -385,11 +385,11 @@ public: QPropertyBindingSourceLocation sourceLocation() const { if (!hasCustomVTable()) - return this->location; - QPropertyBindingSourceLocation location; + return location; + QPropertyBindingSourceLocation result; constexpr auto msg = "Custom location"; - location.fileName = msg; - return location; + result.fileName = msg; + return result; } QPropertyBindingError bindingError() const { return m_error; } QMetaType valueMetaType() const { return metaType; }