[PATCH] D93938: [clang-format] Fixed AfterEnum handling

Ally Tiritoglu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 15 11:11:40 PDT 2021


atirit added inline comments.


================
Comment at: clang/unittests/Format/FormatTest.cpp:13319
   AllmanBraceStyle.BreakBeforeBraces = FormatStyle::BS_Allman;
+  AllmanBraceStyle.AllowShortEnumsOnASingleLine = false;
 
----------------
HazardyKnusperkeks wrote:
> curdeius wrote:
> > That shouldn't be necessary here.
> Is it useful to test once with false and once with true?
Please see the test at `clang/unittests/Format/FormatTest.cpp:13416`:
```
verifyFormat("enum X\n"
             "{\n"
             "  Y = 0\n"
             "}\n",
             AllmanBraceStyle);
```
The default LLVM style that this test bases its style on has `AllowShortEnumsOnASingleLine` set to `true`, which conflicts with this test. Based on what it expects is the resultant formatting, I think it's safe to assume it expects `AllowShortEnumsOnASingleLine` to be `false`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93938/new/

https://reviews.llvm.org/D93938



More information about the cfe-commits mailing list