diff --git a/clang/lib/Format/ContinuationIndenter.h b/clang/lib/Format/ContinuationIndenter.h --- a/clang/lib/Format/ContinuationIndenter.h +++ b/clang/lib/Format/ContinuationIndenter.h @@ -419,9 +419,6 @@ /// The token that needs to be next formatted. FormatToken *NextToken; - /// \c true if this line contains a continued for-loop section. - bool LineContainsContinuedForLoopSection; - /// \c true if \p NextToken should not continue this line. bool NoContinuation; @@ -468,9 +465,6 @@ return NextToken < Other.NextToken; if (Column != Other.Column) return Column < Other.Column; - if (LineContainsContinuedForLoopSection != - Other.LineContainsContinuedForLoopSection) - return LineContainsContinuedForLoopSection; if (NoContinuation != Other.NoContinuation) return NoContinuation; if (StartOfLineLevel != Other.StartOfLineLevel) diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -253,7 +253,6 @@ State.Stack.push_back(ParenState(/*Tok=*/nullptr, FirstIndent, FirstIndent, /*AvoidBinPacking=*/false, /*NoLineBreak=*/false)); - State.LineContainsContinuedForLoopSection = false; State.NoContinuation = false; State.StartOfStringLiteral = 0; State.StartOfLineLevel = 0; @@ -343,8 +342,6 @@ return true; if (CurrentState.BreakBeforeClosingParen && Current.is(tok::r_paren)) return true; - if (Previous.is(tok::semi) && State.LineContainsContinuedForLoopSection) - return true; if (Style.Language == FormatStyle::LK_ObjC && Style.ObjCBreakBeforeNestedBlockParam && Current.ObjCSelectorNameParts > 1 &&