Skip to content

Conversation

r-barnes
Copy link
Contributor

Summary:
In the future LLVM will require that lambdas capture this explicitly. -Wdeprecated-this-capture checks for and enforces this now.

This diff adds an explicit this capture to a lambda to fix an issue that presents similarly to this:

   -> fbcode/path/to/my_file.cpp:66:47: error: implicit capture of 'this' with a capture default of '=' is deprecated [-Werror,-
Wdeprecated-this-capture]
   ->           detail::createIOWorkerProvider(evb, requestsRegistry_);
   ->                                               ^
   -> fbcode/path/to/my_file.cpp:61:30: note: add an explicit capture of 'this' to capture '*this' by reference
   ->   evb->runInEventBaseThread([=, self_weak = std::move(self_weak)]() {
   ->                              ^
   ->                               , this

Differential Revision: D82976785

…/projectaria_tools_gen1_legacy/core/data_provider/VrsDataProviderFactory.cpp +1

Summary:
In the future LLVM will require that lambdas capture `this` explicitly. `-Wdeprecated-this-capture` checks for and enforces this now.

This diff adds an explicit `this` capture to a lambda to fix an issue that presents similarly to this:
```
   -> fbcode/path/to/my_file.cpp:66:47: error: implicit capture of 'this' with a capture default of '=' is deprecated [-Werror,-
Wdeprecated-this-capture]
   ->           detail::createIOWorkerProvider(evb, requestsRegistry_);
   ->                                               ^
   -> fbcode/path/to/my_file.cpp:61:30: note: add an explicit capture of 'this' to capture '*this' by reference
   ->   evb->runInEventBaseThread([=, self_weak = std::move(self_weak)]() {
   ->                              ^
   ->                               , this
```

Differential Revision: D82976785
@meta-cla meta-cla bot added the cla signed label Sep 26, 2025
@facebook-github-bot
Copy link
Contributor

@r-barnes has exported this pull request. If you are a Meta employee, you can view the originating diff in D82976785.

facebook-github-bot pushed a commit that referenced this pull request Sep 26, 2025
…/projectaria_tools_gen1_legacy/core/data_provider/VrsDataProviderFactory.cpp +1 (#271)

Summary:
Pull Request resolved: #271

In the future LLVM will require that lambdas capture `this` explicitly. `-Wdeprecated-this-capture` checks for and enforces this now.

This diff adds an explicit `this` capture to a lambda to fix an issue that presents similarly to this:
```
   -> fbcode/path/to/my_file.cpp:66:47: error: implicit capture of 'this' with a capture default of '=' is deprecated [-Werror,-
Wdeprecated-this-capture]
   ->           detail::createIOWorkerProvider(evb, requestsRegistry_);
   ->                                               ^
   -> fbcode/path/to/my_file.cpp:61:30: note: add an explicit capture of 'this' to capture '*this' by reference
   ->   evb->runInEventBaseThread([=, self_weak = std::move(self_weak)]() {
   ->                              ^
   ->                               , this
```

Differential Revision: D82976785

fbshipit-source-id: fabd5ef094655ac2ca23a173f926dbdb18c5403d
@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by e0121ae.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants