From db89841ef9cb0b1f1ee005a8e18fa9f62bcab150 Mon Sep 17 00:00:00 2001 From: Daniel Jasper <djasper@google.com> Date: Fri, 15 May 2015 09:58:11 +0000 Subject: [PATCH] clang-format: Slightly change format decisions around macro annotations. Before: bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY(aaaaaaaaaaaa) = aaaaaaaaaaaaaaaaaaaaaaaaa; After: bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY(aaaaaaaaaaaa) = aaaaaaaaaaaaaaaaaaaaaaaaa; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237430 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Format/TokenAnnotator.cpp | 2 +- unittests/Format/FormatTest.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp index c2992223791..d61f5b81ba7 100644 --- a/lib/Format/TokenAnnotator.cpp +++ b/lib/Format/TokenAnnotator.cpp @@ -1609,7 +1609,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line, if (Line.First->is(tok::kw_for) && Right.PartOfMultiVariableDeclStmt) return 3; if (Left.is(TT_StartOfName)) - return 20; + return 110; if (InFunctionDecl && Right.NestingLevel == 0) return Style.PenaltyReturnTypeOnItsOwnLine; return 200; diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index ecc1a7e1342..d9dae5193b9 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -4035,6 +4035,9 @@ TEST_F(FormatTest, BreaksFunctionDeclarationsWithTrailingTokens) { verifyGoogleFormat( "bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY(aaaaaaaaaaaa) =\n" " aaaaaaaa::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;"); + verifyGoogleFormat( + "bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY(aaaaaaaaaaaa) =\n" + " aaaaaaaaaaaaaaaaaaaaaaaaa;"); } TEST_F(FormatTest, BreaksDesireably) { -- GitLab