summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-08-24 15:10:01 +0000
committerDaniel Jasper <djasper@google.com>2015-08-24 15:10:01 +0000
commit788ffd71c6c5ccdf63fbe0b82fbee4d2ea225bb3 (patch)
treef5875f19a8a509596a27c0cd677f84be6a0b70cc /clang/lib/Format
parente6f52102a348add8a47572c5e2fdf24a1fcf2a5a (diff)
downloadbcm5719-llvm-788ffd71c6c5ccdf63fbe0b82fbee4d2ea225bb3.tar.gz
bcm5719-llvm-788ffd71c6c5ccdf63fbe0b82fbee4d2ea225bb3.zip
clang-format: Always allow break after leading annotations.
Before: DEPRECATED("Use NewClass::NewFunction instead.") int OldFunction( const string &parameter) {} Could not be formatted at all, as clang-format would both require and disallow the break before "int". llvm-svn: 245846
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 50e04310b63..ac34df2455f 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -2236,7 +2236,7 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line,
return Left.isNot(tok::period); // FIXME: Properly parse ObjC calls.
if (Left.is(tok::r_paren) && Line.Type == LT_ObjCProperty)
return true;
- if (Left.ClosesTemplateDeclaration)
+ if (Left.ClosesTemplateDeclaration || Left.is(TT_FunctionAnnotationRParen))
return true;
if (Right.isOneOf(TT_RangeBasedForLoopColon, TT_OverloadedOperatorLParen,
TT_OverloadedOperator))
OpenPOWER on IntegriCloud