Fix clang-format's expression parser for leading }s.
The leading "}" in the construct "} else if (..) {" was confusing the
expression parser. Thus, no fake parentheses were generated and the
indentation was broken in some cases.
llvm-svn: 183393
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 1c2a540..19f702f 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2073,6 +2073,10 @@
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +\n"
" bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) {\n}");
+ verifyFormat("if () {\n"
+ "} else if (aaaaa && bbbbb > // break\n"
+ " ccccc) {\n"
+ "}");
}
TEST_F(FormatTest, ConstructorInitializers) {