From: Daniel Jasper Date: Tue, 29 Jan 2013 10:00:16 +0000 (+0000) Subject: Reverting changes from r173785 (removing empty lines before "}"). X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a217e1815a8f88506d1d4a2bf3a941014b84193;p=platform%2Fupstream%2Fllvm.git Reverting changes from r173785 (removing empty lines before "}"). This needs some more thinking, e.g. for namespaces, chains of if-else if, ... llvm-svn: 173787 --- diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 58e6648..8eebda0 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -1990,8 +1990,6 @@ private: Style.MaxEmptyLinesToKeep + 1); if (Newlines == 0 && !Tok.IsFirst) Newlines = 1; - if (Tok.Tok.is(tok::r_brace) && Newlines > 1) - Newlines = 1; unsigned Indent = Level * 2; bool IsAccessModifier = false; diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index ef242d7..63110bb 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -136,7 +136,6 @@ TEST_F(FormatTest, FormatsUnwrappedLinesAtFirstFormat) { TEST_F(FormatTest, FormatsNestedBlockStatements) { EXPECT_EQ("{\n {\n {}\n }\n}", format("{{{}}}")); - EXPECT_EQ("{\n {\n {}\n }\n}", format("{{{}}\n\n}")); } TEST_F(FormatTest, FormatsNestedCall) {