diff options
Diffstat (limited to 'clang/lib/Format/UnwrappedLineFormatter.cpp')
-rw-r--r-- | clang/lib/Format/UnwrappedLineFormatter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineFormatter.cpp b/clang/lib/Format/UnwrappedLineFormatter.cpp index ee0de2c8e20d..33be74dfe1b9 100644 --- a/clang/lib/Format/UnwrappedLineFormatter.cpp +++ b/clang/lib/Format/UnwrappedLineFormatter.cpp @@ -888,7 +888,10 @@ private: } bool containsMustBreak(const AnnotatedLine *Line) { - for (const FormatToken *Tok = Line->First; Tok; Tok = Tok->Next) + assert(Line->First); + // Ignore the first token, because in this situation, it applies more to the + // last token of the previous line. + for (const FormatToken *Tok = Line->First->Next; Tok; Tok = Tok->Next) if (Tok->MustBreakBefore) return true; return false; |