diff options
-rw-r--r-- | lib/Format/Format.cpp | 2 | ||||
-rw-r--r-- | unittests/Format/FormatTest.cpp | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 49913aee2e..8f77c77a8e 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -345,7 +345,7 @@ private: if (Left.Tok.is(tok::semi) || Left.Tok.is(tok::comma)) return 0; if (Left.Tok.is(tok::l_paren)) - return 2; + return 20; prec::Level Level = getPrecedence(Line.Tokens[Index]); if (Level != prec::Unknown) diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 5dcd2d1bad..bf35ce1cd8 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -455,6 +455,10 @@ TEST_F(FormatTest, BreaksDesireably) { verifyFormat("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ||\n" " (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);"); + verifyFormat( + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&\n" + " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);"); + // This test case breaks on an incorrect memoization, i.e. an optimization not // taking into account the StopAt value. verifyFormat( |