Skip to content

-Wdeprecated-this-capture #22072

@nickdesaulniers

Description

@nickdesaulniers

What version of protobuf and what language are you using?
Version: 29.3
Language: C++

What operating system (Linux, Windows, ...) and version?

Ubuntu 22.04

What runtime / compiler are you using (e.g., python version or gcc version)

clang-20

What did you do?
Build (via bazel)

What did you expect to see
No compiler diagnostics.

What did you see instead?

external/protobuf+/src/google/protobuf/map.cc:120:36: warning: implicit capture of 'this' with a capture default of '=' is deprecated [-Wdeprecated-this-capture]
  120 |       const TableEntryPtr* table = table_;
      |                                    ^
external/protobuf+/src/google/protobuf/map.cc:119:24: note: add an explicit capture of 'this' to capture '*this' by reference
  119 |     const auto loop = [=](auto destroy_node) {
      |                        ^
      |                         , this

Anything else we should know about your project / environment

We're building C++ in C++20 mode; perhaps this deprecation warning is related/new for C++20?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions