[PATCH] D108752: [clang-format] Group options that pack constructor initializers

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 27 03:22:03 PDT 2021


owenpan added inline comments.


================
Comment at: clang/lib/Format/Format.cpp:1189
   GoogleStyle.DerivePointerAlignment = true;
+  GoogleStyle.PackConstructorInitializers = FormatStyle::PCIS_NextLine;
   GoogleStyle.IncludeStyle.IncludeCategories = {{"^<ext/.*\\.h>", 2, 0, false},
----------------
Need to move this line down to keep the options sorted.


================
Comment at: clang/unittests/Format/FormatTest.cpp:18463-18471
+  Style.PackConstructorInitializers = FormatStyle::PCIS_Never;
+  CHECK_PARSE("PackConstructorInitializers: BinPack",
+              PackConstructorInitializers, FormatStyle::PCIS_BinPack);
+  CHECK_PARSE("PackConstructorInitializers: CurrentLine",
+              PackConstructorInitializers, FormatStyle::PCIS_CurrentLine);
+  CHECK_PARSE("PackConstructorInitializers: NextLine",
+              PackConstructorInitializers, FormatStyle::PCIS_NextLine);
----------------
Will use the default `PCIS_BinPack` as the initial value and move the last `CHECK_PARSE` to the top.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108752



More information about the cfe-commits mailing list