Skip to content

Fix deprecated this capture warning#26174

Open
pps83 wants to merge 5 commits intoprotocolbuffers:mainfrom
pps83:main-this-capture
Open

Fix deprecated this capture warning#26174
pps83 wants to merge 5 commits intoprotocolbuffers:mainfrom
pps83:main-this-capture

Conversation

@pps83
Copy link
Copy Markdown
Contributor

@pps83 pps83 commented Mar 2, 2026

Fixed the following warning:

..\src\google\protobuf\map.cc(302,36): warning : implicit capture of 'this' with a capture default of '=' is deprecated [-Wdeprecated-this-capture]
..\src\google\protobuf\map.cc(300,17): note: add an explicit capture of 'this' to capture '*this' by reference

@pps83 pps83 changed the title Fix warning: deprecated this capture Fix deprecated this capture warning Mar 2, 2026
@honglooker
Copy link
Copy Markdown
Contributor

Hi, can you rebase?

@honglooker honglooker added the c++ label Mar 9, 2026
Fixed the following warning:

> ..\src\google\protobuf\map.cc(302,36): warning : implicit capture of 'this' with a capture default of '=' is deprecated [-Wdeprecated-this-capture]
> ..\src\google\protobuf\map.cc(300,17): note: add an explicit capture of 'this' to capture '*this' by reference
@pps83 pps83 force-pushed the main-this-capture branch from 2319f24 to a3035dc Compare March 10, 2026 19:46
@pps83
Copy link
Copy Markdown
Contributor Author

pps83 commented Mar 10, 2026

Hi, can you rebase?

done. The change is very minimal/trivial, shouldn't have required rebasing imo

@honglooker honglooker added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Mar 10, 2026
@github-actions github-actions Bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Mar 10, 2026
honglooker
honglooker previously approved these changes Mar 10, 2026
Copy link
Copy Markdown
Contributor

@honglooker honglooker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the multiple contributions to Protobuf! :)

@pps83

This comment was marked as off-topic.

@pps83

This comment was marked as off-topic.

@honglooker
Copy link
Copy Markdown
Contributor

Looks like CI is not happy?

D:\a\protobuf\protobuf\src\google\protobuf\map.cc(286): error C3791: 'this' cannot be explicitly captured when the default capture mode is by copy (=)

https://github.com/protocolbuffers/protobuf/actions/runs/22921422258/job/66520525759?pr=26174#logs

> D:\a\protobuf\protobuf\src\google\protobuf\map.cc(286): error C3791: 'this' cannot be explicitly captured when the default capture mode is by copy (=)
@pps83
Copy link
Copy Markdown
Contributor Author

pps83 commented Mar 12, 2026

Looks like CI is not happy?

updated

@honglooker honglooker added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Mar 12, 2026
@github-actions github-actions Bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Mar 12, 2026
@karenwuz karenwuz added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Apr 7, 2026
@github-actions github-actions Bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Apr 7, 2026
@karenwuz karenwuz added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Apr 7, 2026
@github-actions github-actions Bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants