[clang] [clang-format] Allow merging single-line reconstructed macro calls (PR #234728)

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 23 00:20:02 PDT 2026


r4nt wrote:

> Thanks! This fixes the macro cases (`IF_ERROR_RETURN` and 3-arg `ASSIGN_OR_RETURN`) from #234615.
> 
> Looking at the non-macro cases in https://github.com/llvm/llvm-project/pull/234615/files#diff-3f6f57cda9809a57c5b79e22b4181b3f3aaac7216262d0ef44108f39b0443e9bR15242 (like `void f() { if (x) return y; }` or `void f() { [] { return y; }(); }`), those still won't merge because `tryMergeSimpleBlock` only checks 3-line blocks top-down and rejects non-`BK_BracedInit` braces. Do you have fixes in mind for those too, or do you view that as separate?

I'd view them as separate; the first examples makes sense, the second one I'd argue is imo too complex to put onto a single line, but I understand this is a judgement call.

https://github.com/llvm/llvm-project/pull/234728


More information about the cfe-commits mailing list