[PATCH] D101033: [clang-format] fix indent in alignChainedConditionals

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 23 07:06:32 PDT 2021


krasimir added a comment.

I also have a limited understanding based on the original patch https://github.com/llvm/llvm-project/commit/4db94094b469b4715d08ef37f1799bf3ea7ca8ea together with examining affected test cases.
I believe the intention of this section is to handle, e.g., the alignment of `eeeeeeeeeeeeeeeeee` and `bbbbbbbbbbbbbbbb` and `3333333333333333` in cases like this, where the previous toke is the `:`:

  return aaaaaaaaaaaaaaaa ? (aaaaaaaaaaaaaaaaa ? bbbbbbbbbbbbbbbbbb :
                             ccccccccccccc     ? dddddddddddddddddd :
                                                 eeeeeeeeeeeeeeeeee) :
         bbbbbbbbbbbbbbbb ? 2222222222222222 :
                            3333333333333333;

The check for `tok::question` that I remove in this context seems superfluous in the first place.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101033



More information about the cfe-commits mailing list