[PATCH] D143091: [clang-format] PackConstructorInitializers support PCIS_OnlyNextLine

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 4 02:47:36 PST 2023


owenpan added inline comments.


================
Comment at: clang/docs/ClangFormatStyleOptions.rst:3891
 
+  * ``PCIS_OnlyNextLine`` (in configuration: ``OnlyNextLine``)
+    Put all constructor initializers on the next line if they fit.
----------------
Backl1ght wrote:
> @HazardyKnusperkeks	Maybe I misunderstand something, I think I already add an entry here by running `clang/docs/tools/dump_format_style.py`.
`NextLineOnly` instead?


================
Comment at: clang/unittests/Format/FormatTest.cpp:7296-7298
+    verifyFormat("Constructor()\n"
+                 "    : a(a), b(b) {}",
+                 Style);
----------------
Can you add this test to before/after colon below (and elsewhere if applicable)?


================
Comment at: clang/unittests/Format/FormatTest.cpp:7299
+                 Style);
+
     Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeColon;
----------------
Can you add a test here and elsewhere for constructors that don't fit on the next line?


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

https://reviews.llvm.org/D143091



More information about the cfe-commits mailing list