[clang] [clang-format] Add SignatureColumn lambda body indentation (PR #245575)

via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 27 00:33:53 PST 2026


rmarker wrote:

I noticed this PR, and since it is tangentially related to some lambda indention work I was looking into a while ago, I figure that I will give my thoughts.
I was intending to get back to that but ended up getting busy with other things at work. I have been keeping an eye on what's happening though.
I was looking at extending clang-format's use on the codebases at work. That involved opinions around how lambdas are formatted.
I believe that the formatting provided by this change would be desirable and useful to me. So I would support it being added, for what my opinion is worth.

@HazardyKnusperkeks, I think the difference with this new option is more apparent when breaking before lambda braces is enabled.
For example:
```cpp
// Signature
auto f = []() -> int
{
  return 42;
};

// SignatureColumn
auto f = []() -> int
         {
           return 42;
         };
```

While personally I would prefer the style with `SignatureColumn`, I reckon that it would be a significant enough change that it would merit a new setting.



https://github.com/llvm/llvm-project/pull/245575


More information about the cfe-commits mailing list