[clang] [clang-format] fix incorrectly indents lambda trailing return (PR #94560)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 9 16:59:48 PDT 2024


================
@@ -1457,6 +1457,11 @@ unsigned ContinuationIndenter::getNewLineColumn(const LineState &State) {
       !Current.isOneOf(tok::colon, tok::comment)) {
     return ContinuationIndent;
   }
+  if (Current.is(TT_TrailingReturnArrow) &&
+      Previous.isOneOf(tok::kw_noexcept, tok::kw_mutable, tok::kw_constexpr,
+                       tok::kw_consteval, tok::kw_static)) {
----------------
owenca wrote:

```suggestion
                       tok::kw_consteval, tok::kw_static, TT_AttributeSquare)) {
```
And move this `if` block to line 1260.

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


More information about the cfe-commits mailing list