aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-04-22 07:59:53 +0000
committerDaniel Jasper <djasper@google.com>2013-04-22 07:59:53 +0000
commit001bf4e2bedfc6bc6a7638c098a004e4d57e308f (patch)
treed1cd316a28a51dbe448db50682906da90a776c7d /unittests
parent957dac5b6d826bc0c10011c8b5c3f1b8007fda41 (diff)
Fix bin-packing behavior of constructor initialziers.
In Google style, constructor initializers need to be all on one line or one initializer per line if that does not fit. Without this patch, this non-bin-packing-behavior incorrectly extends to the parameters of the initializers. Before: Constructor() : aaaaa(aaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaa) {} After: Constructor() : aaaaa(aaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaa) {} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180001 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Format/FormatTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 2ba6969d25..a64a5bc2ad 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1691,6 +1691,10 @@ TEST_F(FormatTest, ConstructorInitializers) {
" aaaaa(aaaaaa),\n"
" aaaaa(aaaaaa) {}",
OnePerLine);
+ verifyFormat("Constructor()\n"
+ " : aaaaa(aaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaa,\n"
+ " aaaaaaaaaaaaaaaaaaaaaa) {}",
+ OnePerLine);
// This test takes VERY long when memoization is broken.
OnePerLine.BinPackParameters = false;