clang-format: Make braced list formatting more consistent.
Before:
Aaaa aaaaaaaaaaa{
{
a, // +1 indent weird.
b, // trailing comma signals one per line.
}, // trailing comma signals one per line.
};
After:
Aaaa aaaaaaaaaaa{
{
a, // better!?
b, // trailing comma signals one per line.
}, // trailing comma signals one per line.
};
Interesting that this apparently was entirely untested :-(.
llvm-svn: 230627
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index cc27969..9738877 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -5943,6 +5943,11 @@
verifyFormat("std::vector<int> v = {1, 0 /* comment */};");
verifyFormat("Node n{1, Node{1000}, //\n"
" 2};");
+ verifyFormat("Aaaa aaaaaaa{\n"
+ " {\n"
+ " aaaa,\n"
+ " },\n"
+ "};");
// In combination with BinPackParameters = false.
FormatStyle NoBinPacking = getLLVMStyle();