diff options
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 199fc022048..798e4f3aecd 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -536,9 +536,10 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State, // If we encounter a closing ), ], } or >, we can remove a level from our // stacks. - if (Current.isOneOf(tok::r_paren, tok::r_square) || - (Current.is(tok::r_brace) && State.NextToken != Line.First) || - State.NextToken->Type == TT_TemplateCloser) { + if (State.Stack.size() > 1 && + (Current.isOneOf(tok::r_paren, tok::r_square) || + (Current.is(tok::r_brace) && State.NextToken != Line.First) || + State.NextToken->Type == TT_TemplateCloser)) { State.Stack.pop_back(); --State.ParenLevel; } |