From 60065cc08ef56926ceb3a87a49466e9dbf5bb5c4 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Sat, 2 Nov 2024 23:18:49 +0200 Subject: [PATCH] platforms/windows: fix deprecated C++ 20 implicit capture of this in [=] With MinGW, GCC and Clang `[=, this]` is acceptable in C++20 mode, but MSVC on the CI still builds with C++17. So use `[&]`, the other two variables used inside the lambda are (const) built-in types, taking by reference is the same as taking by copy. Amends a90d99d8da9b2be2e6b8e981cd9dabfb1641e985. Change-Id: Ib1c746ccf1c02b2ee3891eca5bddd7e47f559dc5 Reviewed-by: Marc Mutz Reviewed-by: Oliver Wolff (cherry picked from commit bac7f20acd37911813bd774afea55823b8320aa2) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/windows/qwindowswindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 1411d5ae43e..f44a28f5636 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1380,7 +1380,7 @@ void QWindowsForeignWindow::setParent(const QPlatformWindow *newParentWindow) qCDebug(lcQpaWindow) << __FUNCTION__ << window() << "newParent=" << newParentWindow << newParent << "oldStyle=" << debugWinStyle(oldStyle); - auto updateWindowFlags = [=]{ + auto updateWindowFlags = [&] { // Top level window flags need to be set/cleared manually. DWORD newStyle = oldStyle; if (isTopLevel) {