]> granicus.if.org Git - clang/commitdiff
clang-format: Fix false positive in function annotation detection.
authorDaniel Jasper <djasper@google.com>
Wed, 27 May 2015 04:55:47 +0000 (04:55 +0000)
committerDaniel Jasper <djasper@google.com>
Wed, 27 May 2015 04:55:47 +0000 (04:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238285 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.cpp

index 8229471071ccecbed8b526739affba64c04e1323..98f5709b906210cee86c9fbe999adf0124b9986e 100644 (file)
@@ -925,7 +925,7 @@ private:
         Current.Type = TT_CastRParen;
       if (Current.MatchingParen && Current.Next &&
           !Current.Next->isBinaryOperator() &&
-          !Current.Next->isOneOf(tok::semi, tok::colon))
+          !Current.Next->isOneOf(tok::semi, tok::colon, tok::l_brace))
         if (FormatToken *BeforeParen = Current.MatchingParen->Previous)
           if (BeforeParen->is(tok::identifier) &&
               BeforeParen->TokenText == BeforeParen->TokenText.upper() &&
index ca50be98fe393f647b305ae2118d66c63dfddd18..1c100c3b9b0678542c5c15d9e6682d276490127f 100644 (file)
@@ -4064,6 +4064,8 @@ TEST_F(FormatTest, FunctionAnnotations) {
   // Not function annotations.
   verifyFormat("ASSERT(\"aaaaa\") << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                "                << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+  verifyFormat("TEST_F(ThisIsATestFixtureeeeeeeeeeeee,\n"
+               "       ThisIsATestWithAReallyReallyReallyReallyLongName) {}");
 }
 
 TEST_F(FormatTest, BreaksDesireably) {