[all-commits] [llvm/llvm-project] 7b7d2d: [llvm][DebugInfo] Fix c++20 warnings in LVOptions....

David Spickett via All-commits all-commits at lists.llvm.org
Fri Jan 26 06:35:31 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b7d2dd7e3e42c941338edcd5dbc2ff0e5426c28
      https://github.com/llvm/llvm-project/commit/7b7d2dd7e3e42c941338edcd5dbc2ff0e5426c28
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2024-01-26 (Fri, 26 Jan 2024)

  Changed paths:
    M llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h

  Log Message:
  -----------
  [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.




More information about the All-commits mailing list