From 0529025648b5e119ea75a06c6819d0f135efe0eb Mon Sep 17 00:00:00 2001 From: Edoardo Sanguineti Date: Tue, 4 Jul 2023 20:42:44 +0200 Subject: [PATCH] [libc++] Use this in lamba capture in "&" seemed to be used in a situation where perhaps it's not the best option. Other libc++ modules make use of [this] when calling functions from the same class. [this] would be the appropriate lambda capture specifier to use in this situation. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D154358 --- libcxx/include/latch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcxx/include/latch b/libcxx/include/latch index 8e1309e..cb33666 100644 --- a/libcxx/include/latch +++ b/libcxx/include/latch @@ -96,7 +96,7 @@ public: inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void wait() const { - __cxx_atomic_wait(&__a_.__a_, [&]() -> bool { + __cxx_atomic_wait(&__a_.__a_, [this]() -> bool { return try_wait(); }); } -- 2.7.4