diff options
-rw-r--r-- | clang/lib/Format/Format.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 2 | ||||
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index e1a0874e068..f66d95c9109 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -127,7 +127,7 @@ namespace format { void setDefaultPenalties(FormatStyle &Style) { Style.PenaltyBreakComment = 45; - Style.PenaltyBreakFirstLessLess = 100; + Style.PenaltyBreakFirstLessLess = 180; Style.PenaltyBreakString = 1000; Style.PenaltyExcessCharacter = 1000000; } diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index cdac8ab6863..b903597b437 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1082,7 +1082,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line, Content = Content.drop_back(1).drop_front(1).trim(); if (Content.size() > 1 && (Content.back() == ':' || Content.back() == '=')) - return 20; + return 50; } return prec::Shift; } diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 241609051a0..49b51a94e46 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -2999,6 +2999,9 @@ TEST_F(FormatTest, AlignsPipes) { " << \" ddd = [\" << pkt.ddd << \"]\\n\"\n" " << \"}\";"); + verifyFormat("llvm::outs() << \"aaaaaaaaaaaaaaaa: \" << aaaaaaaaaaaaaaaa\n" + " << \"aaaaaaaaaaaaaaaa: \" << aaaaaaaaaaaaaaaa\n" + " << \"aaaaaaaaaaaaaaaa: \" << aaaaaaaaaaaaaaaa;"); verifyFormat( "llvm::outs() << \"aaaaaaaaaaaaaaaaa = \" << aaaaaaaaaaaaaaaaa\n" " << \"bbbbbbbbbbbbbbbbb = \" << bbbbbbbbbbbbbbbbb\n" |