diff options
| author | Daniel Jasper <djasper@google.com> | 2013-04-22 07:59:53 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2013-04-22 07:59:53 +0000 |
| commit | cc960fa6452199e65ed19af2f588cd658f6a1b6d (patch) | |
| tree | 298ad3d6cff7a57c712cde06db541b2e2b76c2c4 /clang/unittests/Format/FormatTest.cpp | |
| parent | 44c6aa670fd5d694f2c5adb5fd1e50e709b58e59 (diff) | |
| download | bcm5719-llvm-cc960fa6452199e65ed19af2f588cd658f6a1b6d.tar.gz bcm5719-llvm-cc960fa6452199e65ed19af2f588cd658f6a1b6d.zip | |
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
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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; |

