summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-01-14 09:47:57 +0000
committerDaniel Jasper <djasper@google.com>2015-01-14 09:47:57 +0000
commita831c58e53a8a37169ede3e9dcbadf0873ef47c8 (patch)
treef516955351f15c5f9877d102ad694da5a5236f66 /clang/lib
parent0ebb309e47f88cecf7c3a6f36ee04d0a58d576cf (diff)
downloadbcm5719-llvm-a831c58e53a8a37169ede3e9dcbadf0873ef47c8.tar.gz
bcm5719-llvm-a831c58e53a8a37169ede3e9dcbadf0873ef47c8.zip
clang-format: [Java] Don't get confused by leading annotations.
Before: @Test(a) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaa); After: @Test(a) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 225962
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index b4eb3656bdf..11dd2be619d 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -458,7 +458,8 @@ private:
return false;
if (Line.MustBeDeclaration && Contexts.size() == 1 &&
!Contexts.back().IsExpression && Line.First->isNot(TT_ObjCProperty) &&
- (!Tok->Previous || Tok->Previous->isNot(tok::kw_decltype)))
+ (!Tok->Previous ||
+ !Tok->Previous->isOneOf(tok::kw_decltype, TT_LeadingJavaAnnotation)))
Line.MightBeFunctionDecl = true;
break;
case tok::l_square:
OpenPOWER on IntegriCloud