summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-11-26 11:20:43 +0000
committerDaniel Jasper <djasper@google.com>2014-11-26 11:20:43 +0000
commit07013a42d2f13043ee1237071f41361cecc581ff (patch)
tree2da0fef489a2e0d1c2e73dd38218e95e86ba829e /clang/lib
parent2db4107a36938782ed70546384e840d2ecd60c61 (diff)
downloadbcm5719-llvm-07013a42d2f13043ee1237071f41361cecc581ff.tar.gz
bcm5719-llvm-07013a42d2f13043ee1237071f41361cecc581ff.zip
clang-format: [Java] Fix breaking after annotations.
Before: @Annotation1 // comment @Annotation2 class C {} After: @Annotation1 // comment @Annotation2 class C {} llvm-svn: 222825
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 3daea77f968..9b32c35601f 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -864,7 +864,8 @@ private:
Current.Previous->is(tok::at) &&
Current.isNot(Keywords.kw_interface)) {
const FormatToken &AtToken = *Current.Previous;
- if (!AtToken.Previous || AtToken.Previous->is(TT_LeadingJavaAnnotation))
+ const FormatToken *Previous = AtToken.getPreviousNonComment();
+ if (!Previous || Previous->is(TT_LeadingJavaAnnotation))
Current.Type = TT_LeadingJavaAnnotation;
else
Current.Type = TT_JavaAnnotation;
OpenPOWER on IntegriCloud