[clang] [clang-format] Wrap and indent lambda braces in GNU style (PR #135479)

via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 12 01:16:20 PDT 2025


================
@@ -1334,6 +1334,11 @@ unsigned ContinuationIndenter::getNewLineColumn(const LineState &State) {
            Style.IndentWidth;
   }
 
+  if (Style.BraceWrapping.BeforeLambdaBody &&
+      Style.BraceWrapping.IndentBraces && Current.is(TT_LambdaLBrace)) {
+    return CurrentState.Indent + Style.IndentWidth;
+  }
----------------
rmarker wrote:

I think that this needs handling for `LBI_OuterScope` as well.

It might also be worth extracting the handling for `TT_LambdaLBrace` from the `if` below and putting it here to keep it all together?

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


More information about the cfe-commits mailing list