diff options
author | Daniel Jasper <djasper@google.com> | 2014-08-13 08:46:21 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-08-13 08:46:21 +0000 |
commit | 839922e9d1ce6d4d0ab94a6a7f2cdc88c2357a7b (patch) | |
tree | ae46696c6377e851a3d170c321b7b12d532598f5 /clang/unittests/Format/FormatTest.cpp | |
parent | 5b1a04426bad9e68e6ab695441582b6067696894 (diff) | |
download | bcm5719-llvm-839922e9d1ce6d4d0ab94a6a7f2cdc88c2357a7b.tar.gz bcm5719-llvm-839922e9d1ce6d4d0ab94a6a7f2cdc88c2357a7b.zip |
clang-format: Format long lists in columns if without bin-packing.
After (even with BinPacking = false):
const Aaaaaa aaaaa = {
aaaaa, bbbbb, ccccc, ddddd, eeeee, ffffff, ggggg, hhhhhh,
iiiiii, jjjjjj, kkkkkk, aaaaa, bbbbb, ccccc, ddddd, eeeee,
ffffff, ggggg, hhhhhh, iiiiii, jjjjjj, kkkkkk,
};
Before:
<each element on its own line>
This fixes http://llvm.org/PR20623.
llvm-svn: 215529
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 1bd52aa9b5e..cc16c334135 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -5441,6 +5441,13 @@ TEST_F(FormatTest, LayoutCxx11BraceInitializers) { " kkkkkk,\n" "};", NoBinPacking); + verifyFormat( + "const Aaaaaa aaaaa = {\n" + " aaaaa, bbbbb, ccccc, ddddd, eeeee, ffffff, ggggg, hhhhhh,\n" + " iiiiii, jjjjjj, kkkkkk, aaaaa, bbbbb, ccccc, ddddd, eeeee,\n" + " ffffff, ggggg, hhhhhh, iiiiii, jjjjjj, kkkkkk,\n" + "};", + NoBinPacking); // FIXME: The alignment of these trailing comments might be bad. Then again, // this might be utterly useless in real code. |