diff options
| author | Daniel Jasper <djasper@google.com> | 2014-07-15 09:00:34 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2014-07-15 09:00:34 +0000 |
| commit | fcfac10c8a74ac086fe017b39a114ccfa19ea4fd (patch) | |
| tree | f21abf5af4741e277b79d768882017755602386a /clang/unittests/Format/FormatTest.cpp | |
| parent | bce3cf8074353ffb801ddeded05baf527fa6c127 (diff) | |
| download | bcm5719-llvm-fcfac10c8a74ac086fe017b39a114ccfa19ea4fd.tar.gz bcm5719-llvm-fcfac10c8a74ac086fe017b39a114ccfa19ea4fd.zip | |
clang-format: Improve heuristic around avoiding bad line breaks.
Now, this can be properly formatted:
static_cast<A< //
B> *>( //
);
Before, clang-format could end up, not formatting the code at all.
llvm-svn: 213055
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 81b233c2f54..2ac017c6f59 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -4467,6 +4467,14 @@ TEST_F(FormatTest, WrapsTemplateDeclarations) { " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>(\n" " bbbbbbbbbbbbbbbbbbbbbbbb);", getLLVMStyleWithColumns(72)); + EXPECT_EQ("static_cast<A< //\n" + " B> *>(\n" + "\n" + " );", + format("static_cast<A<//\n" + " B>*>(\n" + "\n" + " );")); FormatStyle AlwaysBreak = getLLVMStyle(); AlwaysBreak.AlwaysBreakTemplateDeclarations = true; |

