[PATCH] D93839: [clang-format] PR48594 BraceWrapping: SplitEmptyRecord ignored for templates

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 28 07:29:14 PST 2020


MyDeveloperDay added inline comments.


================
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:252
+
+      if (Tok && Tok->is(tok::kw_template) &&
+          Style.BraceWrapping.SplitEmptyRecord && EmptyBlock) {
----------------
HazardyKnusperkeks wrote:
> Why is this not just also in the previous if?
> I see that the condition is a bit different, but what would happen if the condition is `SplitEmptyRecord && !EmptyBlock`?
non empty blocks are handled by the code below.

The reason the condition is different is to do with the fact that the merging is required to ensure concepts are not overly broken apart, this condition purely detects where we want to ensure we split the empty block.


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

https://reviews.llvm.org/D93839



More information about the cfe-commits mailing list