Fix a bug in the line merging.
If the first line of a merge would exactly fit into the column limit,
an unsigned overflow made us not break.
llvm-svn: 172426
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 742b9a8..4e9fd40 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -1408,6 +1408,8 @@
unsigned Length = 0;
if (!fitsIntoLimit(I->First, Limit, &Length))
return false;
+ if (Limit == Length)
+ return true; // Couldn't fit a space.
Limit -= Length + 1; // One space.
if (I + 1 == E)
return true;