[all-commits] [llvm/llvm-project] 07fe45: [clang-format] Fix SplitEmptyRecord affecting Spli...

Marek Kurdej via All-commits all-commits at lists.llvm.org
Tue Dec 21 07:54:34 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 07fe45130546001632e1a6005922c58154e72fe9
      https://github.com/llvm/llvm-project/commit/07fe45130546001632e1a6005922c58154e72fe9
  Author: Marek Kurdej <marek.kurdej+llvm.org at gmail.com>
  Date:   2021-12-21 (Tue, 21 Dec 2021)

  Changed paths:
    M clang/lib/Format/UnwrappedLineFormatter.cpp
    M clang/unittests/Format/FormatTest.cpp

  Log Message:
  -----------
  [clang-format] Fix SplitEmptyRecord affecting SplitEmptyFunction.

Fixes https://github.com/llvm/llvm-project/issues/50051.

Given the style:
```
BraceWrapping
  AfterFunction: true
 SplitEmptyFunction: true
 SplitEmptyRecord: false
...
```

The code that should be like:
```
void f(int aaaaaaaaaaaaaaaaaaaaaaaaaaaa,
       int bbbbbbbbbbbbbbbbbbbbbbbb)
{
}
```

gets the braces merged together:
```
void f(int aaaaaaaaaaaaaaaaaaaaaaaaaaaa,
       int bbbbbbbbbbbbbbbbbbbbbbbb)
{}
```

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D116049




More information about the All-commits mailing list