r238285 - clang-format: Fix false positive in function annotation detection.
Daniel Jasper
djasper at google.com
Tue May 26 21:55:47 PDT 2015
Author: djasper
Date: Tue May 26 23:55:47 2015
New Revision: 238285
URL: http://llvm.org/viewvc/llvm-project?rev=238285&view=rev
Log:
clang-format: Fix false positive in function annotation detection.
Modified:
cfe/trunk/lib/Format/TokenAnnotator.cpp
cfe/trunk/unittests/Format/FormatTest.cpp
Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=238285&r1=238284&r2=238285&view=diff
==============================================================================
--- cfe/trunk/lib/Format/TokenAnnotator.cpp (original)
+++ cfe/trunk/lib/Format/TokenAnnotator.cpp Tue May 26 23:55:47 2015
@@ -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() &&
Modified: cfe/trunk/unittests/Format/FormatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=238285&r1=238284&r2=238285&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTest.cpp Tue May 26 23:55:47 2015
@@ -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) {
More information about the cfe-commits
mailing list