diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2021-12-25 22:30:44 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2021-12-25 22:30:44 +0000 |
| commit | 77fc4c146f0870ffb09c1afb823ccbe742c5e6ff (patch) | |
| tree | 5c0eb39553003b9c75a901af6bc4ddabd6f2f28c /clang/lib/Format/WhitespaceManager.cpp | |
| parent | f65dcba83ce5035ab88a85fe17628b447eb56e1b (diff) | |
Diffstat (limited to 'clang/lib/Format/WhitespaceManager.cpp')
| -rw-r--r-- | clang/lib/Format/WhitespaceManager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp index fae8a1c3fdc6..96a66da0f82b 100644 --- a/clang/lib/Format/WhitespaceManager.cpp +++ b/clang/lib/Format/WhitespaceManager.cpp @@ -1282,9 +1282,12 @@ void WhitespaceManager::generateChanges() { C.EscapedNewlineColumn); else appendNewlineText(ReplacementText, C.NewlinesBefore); + // FIXME: This assert should hold if we computed the column correctly. + // assert((int)C.StartOfTokenColumn >= C.Spaces); appendIndentText( ReplacementText, C.Tok->IndentLevel, std::max(0, C.Spaces), - C.StartOfTokenColumn - std::max(0, C.Spaces), C.IsAligned); + std::max((int)C.StartOfTokenColumn, C.Spaces) - std::max(0, C.Spaces), + C.IsAligned); ReplacementText.append(C.CurrentLinePrefix); storeReplacement(C.OriginalWhitespaceRange, ReplacementText); } |
