From f8bf5eddb4e579c51ff2d98a11fc7dba91aa2950 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Thu, 10 Oct 2024 07:15:42 -0700 Subject: [PATCH] Fix -Wdeprecated-this-capture warning (#17882) `this` needs to be explicitly captured to avoid the warning. Closes #17882 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/17882 from dotnwat:patch-1 348ce1b8b245ea0d838c8a0d51672cf7d61fe8f7 PiperOrigin-RevId: 684433123 --- src/google/protobuf/map.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/map.cc b/src/google/protobuf/map.cc index 570b61bec8..da6ceb99d9 100644 --- a/src/google/protobuf/map.cc +++ b/src/google/protobuf/map.cc @@ -116,7 +116,7 @@ void UntypedMapBase::ClearTable(const ClearInput input) { ABSL_DCHECK_NE(num_buckets_, kGlobalEmptyTableSize); if (alloc_.arena() == nullptr) { - const auto loop = [=](auto destroy_node) { + const auto loop = [&, this](auto destroy_node) { const TableEntryPtr* table = table_; for (map_index_t b = index_of_first_non_null_, end = num_buckets_; b < end; ++b) {