summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp2
-rw-r--r--clang/unittests/Format/FormatTest.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 7f573061594..cf6373f4565 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -2001,7 +2001,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
if (Left.isOneOf(tok::plus, tok::comma) && Left.Previous &&
Left.Previous->isLabelString() &&
(Left.NextOperator || Left.OperatorIndex != 0))
- return 100;
+ return 45;
if (Right.is(tok::plus) && Left.isLabelString() &&
(Right.NextOperator || Right.OperatorIndex != 0))
return 25;
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 09b85357d15..6f9df680eef 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -5220,6 +5220,10 @@ TEST_F(FormatTest, KeepStringLabelValuePairsOnALine) {
verifyFormat("string v = StrCat(\"aaaaaaaaaaaa: \" +\n"
" (aaaaaaa + aaaaa));",
getLLVMStyleWithColumns(40));
+ verifyFormat(
+ "string v = StrCat(\"aaaaaaaaaaaaaaaaaaaaaaaaaaa: \",\n"
+ " SomeFunction(aaaaaaaaaaaa, aaaaaaaa.aaaaaaa),\n"
+ " bbbbbbbbbbbbbbbbbbbbbbb);");
}
TEST_F(FormatTest, UnderstandsEquals) {
OpenPOWER on IntegriCloud