[clang] clang-format: ensure ternary operands are aligned (PR #196697)
Eugene Shalygin via cfe-commits
cfe-commits at lists.llvm.org
Sat May 9 15:07:28 PDT 2026
================
@@ -1276,6 +1276,21 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State,
CurrentState.BreakBeforeParameter = false;
CurrentState.AlignedTo = &Current;
}
+ if (!CurrentState.AlignedTo && Current.is(TT_ConditionalExpr)) {
----------------
zeule wrote:
I simply want to avoid repeatedly setting it. If it is set at this point, it was set by this very code fragment during the previous invocation of `addTokensOnNewLine()`. I think there is no harm to leave the old value, because the token stream isn't changing.
https://github.com/llvm/llvm-project/pull/196697
More information about the cfe-commits
mailing list