aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Format/TokenAnnotator.cpp2
-rw-r--r--unittests/Format/FormatTest.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp
index ac127160d1..67ad86b624 100644
--- a/lib/Format/TokenAnnotator.cpp
+++ b/lib/Format/TokenAnnotator.cpp
@@ -894,7 +894,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
if (Right.isOneOf(tok::arrow, tok::period)) {
if (Line.Type == LT_BuilderTypeCall)
- return 5;
+ return 14;
if (Left.isOneOf(tok::r_paren, tok::r_square) && Left.MatchingParen &&
Left.MatchingParen->ParameterCount > 0)
return 20; // Should be smaller than breaking at a nested comma.
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index fed50f9681..79163a6818 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1664,6 +1664,10 @@ TEST_F(FormatTest, WrapsAtFunctionCallsIfNecessary) {
verifyFormat(
"aaaaaaaaaaaaaaaaaaaaaaaaa(\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa().aaaaaaaaaaaaaaaaa());");
+ verifyFormat("a->aaaaaa()->aaaaaaaaaaa(aaaaaaaa()->aaaaaa()->aaaaa() *\n"
+ " aaaaaaaaa()->aaaaaa()->aaaaa());");
+ verifyFormat("a->aaaaaa()->aaaaaaaaaaa(aaaaaaaa()->aaaaaa()->aaaaa() ||\n"
+ " aaaaaaaaa()->aaaaaa()->aaaaa());");
FormatStyle NoBinPacking = getLLVMStyle();
NoBinPacking.BinPackParameters = false;