From: Daniel Jasper Date: Mon, 19 Jan 2015 10:50:08 +0000 (+0000) Subject: clang-format: Remove assert that isn't helpful. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f083fd73e7aca8768ad21aee71bca2d6718eaa8;p=clang clang-format: Remove assert that isn't helpful. This assert would trigger on: #d , = } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226446 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Format/ContinuationIndenter.cpp b/lib/Format/ContinuationIndenter.cpp index 4cc92b02a9..4b5ad59973 100644 --- a/lib/Format/ContinuationIndenter.cpp +++ b/lib/Format/ContinuationIndenter.cpp @@ -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; diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 8e770c2e9c..e1484b7239 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -2596,6 +2596,7 @@ TEST_F(FormatTest, MacroDefinitionsWithIncompleteCode) { verifyFormat("#pragma omp threadprivate( \\\n" " y)), // expected-warning", getLLVMStyleWithColumns(28)); + verifyFormat("#d, = };"); } TEST_F(FormatTest, MacrosWithoutTrailingSemicolon) {