]> granicus.if.org Git - clang/commitdiff
clang-format: Slightly change format decisions around macro annotations.
authorDaniel Jasper <djasper@google.com>
Fri, 15 May 2015 09:58:11 +0000 (09:58 +0000)
committerDaniel Jasper <djasper@google.com>
Fri, 15 May 2015 09:58:11 +0000 (09:58 +0000)
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
unittests/Format/FormatTest.cpp

index c2992223791c427a916451ad63342e50fa8c2468..d61f5b81ba7f2950f2dfcde98bb154f844ca1996 100644 (file)
@@ -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;
index ecc1a7e134265242039db914cfd5c3d0ad93864e..d9dae5193b9a6b540267948e9f218309146bb252 100644 (file)
@@ -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) {