Clang-format was indenting the lines following the ? in the added test
case by +5 instead of +4. This only happens in a very specific
situation, where the ? is followed by a multiline block comment, as in
the example. This fix addresses this without regressing any of the
existing tests.
From my understanding 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: I believe currently we don't support a style where chained ternaries are formatted with newlines after the ?-s and alignment across the operands on a new line after the line ending with ?.