[PATCH] D105099: [clang-format] Add an option to put one constructor initializer per line

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 29 14:20:37 PDT 2021


owenpan added a comment.

In D105099#2847332 <https://reviews.llvm.org/D105099#2847332>, @MyDeveloperDay wrote:

> We already have
>
> `AllowAllConstructorInitializersOnNextLine` and `ConstructorInitializerAllOnOneLineOrOnePerLine`
>
> Sort of feels like we need to combine them with this,
>
> I should also say I'd quite like this functionality, its just how do we deliver it via the options that I think we might want to think about, as I sort of feel the 3 options (if we introduced another) are competing with each other.

`AllowAllConstructorInitializersOnNextLine` is like a sub-option of `ConstructorInitializerAllOnOneLineOrOnePerLine`; it has no effect unless the latter is `true`. The new `ConstructorInitializerAlwaysOnePerLine` option, if set to `true`, overrides `ConstructorInitializerAllOnOneLineOrOnePerLine` as it should with //Always//. I think it would be contrived to combine these options in an enum. Is it even practical to do so without breaking the unit tests and backward compatibility?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105099/new/

https://reviews.llvm.org/D105099



More information about the cfe-commits mailing list