]> granicus.if.org Git - clang/commitdiff
clang-format: Remove assert that isn't helpful.
authorDaniel Jasper <djasper@google.com>
Mon, 19 Jan 2015 10:50:08 +0000 (10:50 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 19 Jan 2015 10:50:08 +0000 (10:50 +0000)
This assert would trigger on:
  #d , = }

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226446 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Format/ContinuationIndenter.cpp
unittests/Format/FormatTest.cpp

index 4cc92b02a9e58f1c096d2be4d48eb7bf08c9659e..4b5ad599734ff4486a583d6259413004f5edac50 100644 (file)
@@ -783,7 +783,6 @@ void ContinuationIndenter::moveStatePastFakeLParens(LineState &State,
 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;
index 8e770c2e9cd56cd634a2d1e991c64b580ed66660..e1484b7239cd093263d1ff90e9f5aaa34400d3e3 100644 (file)
@@ -2596,6 +2596,7 @@ TEST_F(FormatTest, MacroDefinitionsWithIncompleteCode) {
   verifyFormat("#pragma omp threadprivate( \\\n"
                "    y)), // expected-warning",
                getLLVMStyleWithColumns(28));
+  verifyFormat("#d, = };");
 }
 
 TEST_F(FormatTest, MacrosWithoutTrailingSemicolon) {