diff options
author | Owen Pan <owenpiano@gmail.com> | 2025-02-20 19:06:51 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-20 19:06:51 -0800 |
commit | 204dcafec0ecf0db81d420d2de57b02ada6b09ec (patch) | |
tree | 97b2264ab39ef91d8f64c30a558958b13ba12df1 /clang/lib/Format/ContinuationIndenter.cpp | |
parent | 89e80abbc58b5d92f3a0eaa393a0b095aac11ec2 (diff) | |
download | llvm-204dcafec0ecf0db81d420d2de57b02ada6b09ec.zip llvm-204dcafec0ecf0db81d420d2de57b02ada6b09ec.tar.gz llvm-204dcafec0ecf0db81d420d2de57b02ada6b09ec.tar.bz2 |
[clang-format] Fix a bug in BCIS_AfterColon and `ColumnLimit: 0` (#127964)
Fixes #127622
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 3e51b4aa..d49128c 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -473,9 +473,8 @@ bool ContinuationIndenter::mustBreak(const LineState &State) { (State.Column + State.Line->Last->TotalLength - Previous.TotalLength > getColumnLimit(State) || CurrentState.BreakBeforeParameter) && - (!Current.isTrailingComment() || Current.NewlinesBefore > 0) && - (Style.BreakConstructorInitializers != FormatStyle::BCIS_BeforeColon || - Style.ColumnLimit > 0 || Current.NewlinesBefore > 0)) { + ((!Current.isTrailingComment() && Style.ColumnLimit > 0) || + Current.NewlinesBefore > 0)) { return true; } |