================
@@ -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.
----------------
rudolflovrencic wrote:

I am a bit confused now since you say:

> the Loop/If option should control the behavior everything up to the first `{`

> Somehow the initial options for the Loop/If appeared to assume these were 
> just for braceless one-liners, which makes some sense. However, as the scope 
> has expanded to include braces, the need to treat the cases of bracless, with 
> braces, braces on same/next line, and ability to fit entire braced expression 
> on one line, have all become necessary to handle simultaneously.

The first statement implies that `AllowShortLoopsOnASingleLine` should be 
concerned with `while (...) `. The second statement says that scope has 
expanded so that entirety of the statement, including the braced block, needs 
to be considered simultaneously in order to decide the formatting.

I'm not sure how to continue from here.

https://github.com/llvm/llvm-project/pull/196021
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to