[llvm-branch-commits] [cfe-branch] r261225 - Merging r257763:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Feb 18 08:49:14 PST 2016


Author: hans
Date: Thu Feb 18 10:49:14 2016
New Revision: 261225

URL: http://llvm.org/viewvc/llvm-project?rev=261225&view=rev
Log:
Merging r257763:
------------------------------------------------------------------------
r257763 | djasper | 2016-01-14 05:36:46 -0800 (Thu, 14 Jan 2016) | 8 lines

clang-format: Fix incorrectly enforced linebreak with ColumnLimit 0.

Before:
  aaaa[bbbb]
      .cccc();

After:
  aaaa[bbbb].cccc();
------------------------------------------------------------------------

Modified:
    cfe/branches/release_38/   (props changed)
    cfe/branches/release_38/lib/Format/ContinuationIndenter.cpp
    cfe/branches/release_38/unittests/Format/FormatTest.cpp

Propchange: cfe/branches/release_38/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb 18 10:49:14 2016
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:257652,257695,257710,257831,257838,257853,257861,257869-257871,257947,258110,258396,259183,259260,259598,259874,259931,260370,260616,260637,260851
+/cfe/trunk:257652,257695,257710,257763,257831,257838,257853,257861,257869-257871,257947,258110,258396,259183,259260,259598,259874,259931,260370,260616,260637,260851
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_38/lib/Format/ContinuationIndenter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_38/lib/Format/ContinuationIndenter.cpp?rev=261225&r1=261224&r2=261225&view=diff
==============================================================================
--- cfe/branches/release_38/lib/Format/ContinuationIndenter.cpp (original)
+++ cfe/branches/release_38/lib/Format/ContinuationIndenter.cpp Thu Feb 18 10:49:14 2016
@@ -182,7 +182,7 @@ bool ContinuationIndenter::mustBreak(con
     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))

Modified: cfe/branches/release_38/unittests/Format/FormatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_38/unittests/Format/FormatTest.cpp?rev=261225&r1=261224&r2=261225&view=diff
==============================================================================
--- cfe/branches/release_38/unittests/Format/FormatTest.cpp (original)
+++ cfe/branches/release_38/unittests/Format/FormatTest.cpp Thu Feb 18 10:49:14 2016
@@ -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) {




More information about the llvm-branch-commits mailing list