[PATCH] D116049: [clang-format] Fix SplitEmptyRecord affecting SplitEmptyFunction.

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 20 09:19:32 PST 2021


curdeius created this revision.
curdeius added reviewers: MyDeveloperDay, HazardyKnusperkeks, owenpan.
curdeius requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

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)
  {}


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116049

Files:
  clang/lib/Format/UnwrappedLineFormatter.cpp
  clang/unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116049.395477.patch
Type: text/x-patch
Size: 6201 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211220/c42e08a4/attachment-0001.bin>


More information about the cfe-commits mailing list