From cc960fa6452199e65ed19af2f588cd658f6a1b6d Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 22 Apr 2013 07:59:53 +0000 Subject: 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) {} llvm-svn: 180001 --- clang/unittests/Format/FormatTest.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/unittests/Format/FormatTest.cpp') diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 2ba6969d254..a64a5bc2ad1 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/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; -- cgit v1.2.3