diff options
| author | Daniel Jasper <djasper@google.com> | 2017-01-13 23:18:16 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2017-01-13 23:18:16 +0000 |
| commit | e61f9f9949a435d8396613b46c6ed7b65d61602b (patch) | |
| tree | 2569760eefa77a3c43b5849ed3c961a6d50855bb /clang/unittests/Format | |
| parent | 2b579878278580aabded5ee4e6e3676dc7402cab (diff) | |
| download | bcm5719-llvm-e61f9f9949a435d8396613b46c6ed7b65d61602b.tar.gz bcm5719-llvm-e61f9f9949a435d8396613b46c6ed7b65d61602b.zip | |
clang-format: Fix bug in making line break decisions.
Here, the optimization to not line wrap when it would not lead to a
reduction in columns was overwriting and enforced break that we want to
do no matter what.
Before:
int i = someFunction(
aaaaaaa,
0).aaa(aaaaaaaaaaaaa) *
aaaaaaa +
aaaaaaa;
After:
int i = someFunction(aaaaaaa, 0)
.aaa(aaaaaaaaaaaaa) *
aaaaaaa +
aaaaaaa;
llvm-svn: 291974
Diffstat (limited to 'clang/unittests/Format')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index b402b5c4a54..150f6077f21 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -3438,6 +3438,12 @@ TEST_F(FormatTest, LineBreakingInBinaryExpressions) { " aaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaa ||\n" " aaaaaaaaaaaaaaaaaaaaaaaaaaaa) {\n}", OnePerLine); + + verifyFormat("int i = someFunction(aaaaaaa, 0)\n" + " .aaa(aaaaaaaaaaaaa) *\n" + " aaaaaaa +\n" + " aaaaaaa;", + getLLVMStyleWithColumns(40)); } TEST_F(FormatTest, ExpressionIndentation) { |

