[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

Gedare Bloom via cfe-commits cfe-commits at lists.llvm.org
Thu May 1 15:43:58 PDT 2025


gedare wrote:

> Why would `AlignAfterControlStatement` have anything to do with `AlignAfterOpenBracket`, which is for arguments of function/macro calls?
> 

Unfortunately, `AlignAfterOpenBracket` is not just for arguments of function/macro calls. It affects parentheses of control statements already, at least in some regard: https://github.com/llvm/llvm-project/pull/77699

We could certainly make the distinction between breaking and alignment more explicit, as mentioned at https://github.com/llvm/llvm-project/issues/80049

That's really what this PR is doing, it is adding an option to break the start of the control expression. The alignment gets inherited from the `AlignAfterOpenBracket`. I guess another possiblity is to call this `AlignAfterControlStatement` and make the `AlignAfterOpenBracket` really only for functions/macros. 

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


More information about the cfe-commits mailing list