r226446 - clang-format: Remove assert that isn't helpful.

Daniel Jasper djasper at google.com
Mon Jan 19 02:50:13 PST 2015


Author: djasper
Date: Mon Jan 19 04:50:08 2015
New Revision: 226446

URL: http://llvm.org/viewvc/llvm-project?rev=226446&view=rev
Log:
clang-format: Remove assert that isn't helpful.

This assert would trigger on:
  #d , = }

Modified:
    cfe/trunk/lib/Format/ContinuationIndenter.cpp
    cfe/trunk/unittests/Format/FormatTest.cpp

Modified: cfe/trunk/lib/Format/ContinuationIndenter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/ContinuationIndenter.cpp?rev=226446&r1=226445&r2=226446&view=diff
==============================================================================
--- cfe/trunk/lib/Format/ContinuationIndenter.cpp (original)
+++ cfe/trunk/lib/Format/ContinuationIndenter.cpp Mon Jan 19 04:50:08 2015
@@ -783,7 +783,6 @@ void ContinuationIndenter::moveStatePast
 void ContinuationIndenter::moveStatePastFakeRParens(LineState &State) {
   for (unsigned i = 0, e = State.NextToken->FakeRParens; i != e; ++i) {
     unsigned VariablePos = State.Stack.back().VariablePos;
-    assert(State.Stack.size() > 1);
     if (State.Stack.size() == 1) {
       // Do not pop the last element.
       break;

Modified: cfe/trunk/unittests/Format/FormatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=226446&r1=226445&r2=226446&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTest.cpp Mon Jan 19 04:50:08 2015
@@ -2596,6 +2596,7 @@ TEST_F(FormatTest, MacroDefinitionsWithI
   verifyFormat("#pragma omp threadprivate( \\\n"
                "    y)), // expected-warning",
                getLLVMStyleWithColumns(28));
+  verifyFormat("#d, = };");
 }
 
 TEST_F(FormatTest, MacrosWithoutTrailingSemicolon) {





More information about the cfe-commits mailing list