================
@@ -15233,6 +15233,65 @@ TEST_F(FormatTest,
PullTrivialFunctionDefinitionsIntoSingleLine) {
"}");
}
+// Even when both short functions and short if statements are enabled, a
+// function body consisting of `if (x) return y;` is parsed as two unwrapped
+// lines (`if (x)` and `return y;`), so `tryMergeSimpleBlock` does not merge
+// the function onto a single line.
+//
+// FIXME: The desired output is `void f() { if (x) return y; }`.
----------------
jmr wrote:
Filed the remaining cases as issues instead:
* #237208: unbraced `if` in a short function isn't merged
* #237211: short functions whose body contains braces (lambda, braced `if`)
aren't merged
https://github.com/llvm/llvm-project/pull/234615
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits