[llvm] [RFC][Docs] Clarify brace omission for single-line bodies (PR #195985)
Shilei Tian via llvm-commits
llvm-commits at lists.llvm.org
Wed May 6 07:39:28 PDT 2026
shiltian wrote:
> where the definition of that is a mixture of author and reviewer opinions
That is exactly what we want to clarify here. IMHO, having a vague standard isn't really better than having no standard at all. The phrase "simple statement" is too vague in this context.
To me, a single-line statement is "simple", but to others, a multi-line statement can still be considered simple. It also depends on how the statement is written. For example, a function call with many scalar arguments may need comments for each argument, which turns a single simple function call into multiple lines. Would that still count as simple?
We've had back-and-forth discussions, if not arguments, several times in the past over this exact definition of "simple". IMO, having something concrete would definitely help and save both authors and reviewers a lot of time.
https://github.com/llvm/llvm-project/pull/195985
More information about the llvm-commits
mailing list