[PATCH] D116314: [clang-format] Add style to separate definition blocks

ksyx via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 31 14:22:27 PST 2021


ksyx marked an inline comment as done.
ksyx added inline comments.


================
Comment at: clang/lib/Format/DefinitionBlockSeparator.cpp:25
+    FormatTokenLexer &Tokens) {
+  if (Style.SeparateDefinitionBlocks == FormatStyle::SDS_Leave)
+    return {{}, 0};
----------------
HazardyKnusperkeks wrote:
> ksyx wrote:
> > HazardyKnusperkeks wrote:
> > > Better, but I still think we should have the assert here. The class should not be instantiated at all, if you don't want to use it.
> > My idea is that it would be too redundant to have every user of this method to check style once before it calls it?
> Who are the users? `clang-format` and maybe its tests. And the only one that really matters is `clang-format`, which does the check.
Does there exist the possibility that some developer just include the header and link to library to obtain replacement analysis result for their other parts of program to use, instead of only clangfmt itself is using this class?


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

https://reviews.llvm.org/D116314



More information about the cfe-commits mailing list