[PATCH] D50078: clang-format: support aligned nested conditionals formatting

Francois Ferrand via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 1 06:56:57 PDT 2018


Typz added a comment.

In https://reviews.llvm.org/D50078#1184015, @djasper wrote:

> - I'd be ok with the suggestion for BreakBeforeTernaryOperators=true


Just to be clear, which suggestion would you be ok with?

  int fooo = aaaa ? 00000
           : bbbb ? 11111
                  : 2222;

or:

  int fooo = aaaa   ? 00000
             : bbbb ? 11111
                    : 2222;



> - I don't think the alignment of "?" and ":" (in the WhitespaceManager) should be always on. I think we'd need a flag for that part

No problem, I'll add the option.


Repository:
  rC Clang

https://reviews.llvm.org/D50078





More information about the cfe-commits mailing list