[PATCH] add option to break constructor initializers before colon

Florian Sowade f.sowade at r9e.de
Thu Dec 5 10:23:51 PST 2013


Hi,

the attached patch adds a clang-format option to always break
constructor initializers before the initial colon.

So this patch adds an option to turn

Constructor : foo(bar)
{}

into

Constructor
    : foo(bar)
{}

I don't know if this style is widely distributed, but I use it to
minimize the diff when I add new members to the list of constructor
initializers, since I can add a second member to the list without
modifying any of the existing lines:

Constructor
    : foo(bar)
    , baz()
{}

>From my understanding this is not possible with the current set of
options.

Florian Sowade
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alwaysBreakConstructorInitializersBeforeColon.patch
Type: text/x-patch
Size: 5379 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131205/53907267/attachment.bin>


More information about the cfe-commits mailing list