Skip to content

Commit ff7e854

Browse files
committed
[clang-format] Fix an assertion failure in Whitespace Manager
1 parent 2c3cae3 commit ff7e854

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Format/WhitespaceManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,9 +1088,9 @@ void WhitespaceManager::alignTrailingComments() {
10881088
else
10891089
ChangeMaxColumn = ChangeMinColumn;
10901090

1091-
if (I + 1 < Size && Changes[I + 1].ContinuesPPDirective) {
1091+
if (I + 1 < Size && Changes[I + 1].ContinuesPPDirective &&
1092+
ChangeMaxColumn >= 2) {
10921093
ChangeMaxColumn -= 2;
1093-
assert(ChangeMaxColumn >= 0);
10941094
}
10951095

10961096
bool WasAlignedWithStartOfNextLine = false;

0 commit comments

Comments
 (0)