If the first line of a merge would exactly fit into the column limit,
an unsigned overflow made us not break.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172426
91177308-0d34-0410-b5e6-
96231b3b80d8
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;
" f();");
verifyFormat("if (a) return;", getLLVMStyleWithColumns(14));
verifyFormat("if (a)\n return;", getLLVMStyleWithColumns(13));
+ verifyFormat("if (aaaaaaaaa)\n"
+ " return;", getLLVMStyleWithColumns(14));
}
TEST_F(FormatTest, ParseIfElse) {