Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm][DebugInfo] Fix c++20 warnings in LVOptions.h (#79585)
Compiling with -DCMAKE_CXX_STANDARD=20 produces 228 warnings from this file due to: ``` LVOptions.h:515:16: warning: implicit capture of 'this' with a capture default of '=' is deprecated [-Wdeprecated-this-capture] ``` So I've changed these to explicitly list the captures, including `this`. As llvm requires at least c++17, I think we could use `[=, *this]` instead. However when I did so I got a lot of errors about const. So on balance, explicitly listing the captures seems better than adding some kind of const cast to each one. These and other warnings can be seen on the c++20 buildbot https://lab.llvm.org/buildbot/#/builders/249.
- Loading branch information
Perhaps using
[&]
to simplify the code - any case where the lambda is only used within the scope it's declared, without any multithreading, seems like it'd be good to use[&]
.