[PATCH] D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set

Francois Ferrand via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 26 07:49:59 PDT 2017

Typz added a comment.

> Ah damn. Didn't think about the precedences. What I wanted was for the highest level to have a one char operator, e.g.
>   bool a = aaaaaa //
>              << bbbb   //
>          | ccccc;

Almost, but not quite:

  bool a = aaaaaa   //
            << bbbb //
         | ccccc;

i.e. the identifiers is indented by 4 characters, then the operator is 'unindented.

> I would still be interested in a coding style that recommends this format.

We are using this at our compagny, but this is neither public nor open source.
I am sure I saw this style somewhere else, but I cannot remember where...
(This is also the style recommended for webkit's when returning booleans : https://webkit.org/code-style-guidelines/#indentation-wrap-bool-op, but probably because the continuation indent is 4...
and I am not sure this guide in Boost's Spirit library counts either: http://www.boost.org/doc/libs/1_56_0/libs/spirit/doc/html/spirit/notes/style_guide.html )


More information about the cfe-commits mailing list