aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2025-02-20 19:06:51 -0800
committerGitHub <noreply@github.com>2025-02-20 19:06:51 -0800
commit204dcafec0ecf0db81d420d2de57b02ada6b09ec (patch)
tree97b2264ab39ef91d8f64c30a558958b13ba12df1 /clang/lib/Format/ContinuationIndenter.cpp
parent89e80abbc58b5d92f3a0eaa393a0b095aac11ec2 (diff)
downloadllvm-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.cpp5
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;
}