================
@@ -895,6 +889,11 @@ class LineJoiner {
Line.startsWithExportBlock()) {
if (IsSplitBlock)
return 0;
+ // The construct-specific options AllowShortIfStatementsOnASingleLine and
+ // AllowShortLoopsOnASingleLine take precedence over
+ // AllowShortBlocksOnASingleLine: a statement whose specific option
+ // disallows merging is not put on a single line even when short blocks
+ // are always allowed.
----------------
gedare wrote:
> If I follow your logic correctly about which option is responsible for which
> part of functions/statements, this looks like the cleanest approach. But,
> after reading "[justify additional style options
> docs](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options)",
> I don't have "_a publicly accessible style guide_" nor is this style "_used
> in a project of significant size (have dozens of contributors)_". So, it's
> your call if you want to have this option or we are ending it here. There is
> also middle ground of just having `AllowShortBlocksOnASingleLine.Attached`
> which would make a difference for me.
That decision would be up to @HazardyKnusperkeks and @mydeveloperday. It does
seem to me that adding the `AllowShortBlocksOnASingleLine.Attached` option will
be the right way to fix the regression though.
https://github.com/llvm/llvm-project/pull/196021
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits