diff --git a/lib/Format/ContinuationIndenter.cpp b/lib/Format/ContinuationIndenter.cpp index 11183355f73a95c8f6e92bc38c170bfcf203c37b..b820f53db52739d5a7f4340d11c4d36a251d3b31 100644 --- a/lib/Format/ContinuationIndenter.cpp +++ b/lib/Format/ContinuationIndenter.cpp @@ -182,7 +182,7 @@ bool ContinuationIndenter::mustBreak(const LineState &State) { return true; unsigned NewLineColumn = getNewLineColumn(State); - if (Current.isMemberAccess() && + if (Current.isMemberAccess() && Style.ColumnLimit != 0 && State.Column + getLengthToNextOperator(Current) > Style.ColumnLimit && (State.Column > NewLineColumn || Current.NestingLevel < State.StartOfLineLevel)) diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 30fd6030dcc84bdeff9616b60a3db048e964ba81..d9a16db74c8893f5e44aef754f7a763cfd9dd8d5 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -6135,6 +6135,9 @@ TEST_F(FormatTest, FormatsArrays) { " .aaaaaaaaaaaaaaaaaaaaaa();"); verifyNoCrash("a[,Y?)]", getLLVMStyleWithColumns(10)); + + FormatStyle NoColumnLimit = getLLVMStyleWithColumns(0); + verifyFormat("aaaaa[bbbbbb].cccccc()", NoColumnLimit); } TEST_F(FormatTest, LineStartsWithSpecialCharacter) {