clang-format: Fix bad indentation of nested blocks.
Before:
DEBUG( //
{ f(); });
After:
DEBUG( //
{ f(); });
Also add additional test to selected formatting of individual statements
in nested blocks.
llvm-svn: 195952
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index d809421..e1960d2 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2465,6 +2465,14 @@
" somethingelse();\n"
"});",
getLLVMStyleWithColumns(40));
+ verifyFormat("DEBUG( //\n"
+ " { f(); }, a);");
+ verifyFormat("DEBUG( //\n"
+ " {\n"
+ " f(); //\n"
+ " },\n"
+ " a);");
+
EXPECT_EQ("call(parameter, {\n"
" something();\n"
" // Comment too\n"
@@ -2532,6 +2540,15 @@
" int j;\n"
"} ) ;",
41, 1, getLLVMStyle()));
+ EXPECT_EQ("DEBUG( {\n"
+ " int i;\n"
+ " int j;\n"
+ "} ) ;",
+ format("DEBUG( {\n"
+ " int i;\n"
+ " int j;\n"
+ "} ) ;",
+ 41, 1, getLLVMStyle()));
EXPECT_EQ("DEBUG({\n"
" int i;\n"
" int j;\n"