From 788ffd71c6c5ccdf63fbe0b82fbee4d2ea225bb3 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 24 Aug 2015 15:10:01 +0000 Subject: clang-format: Always allow break after leading annotations. Before: DEPRECATED("Use NewClass::NewFunction instead.") int OldFunction( const string ¶meter) {} Could not be formatted at all, as clang-format would both require and disallow the break before "int". llvm-svn: 245846 --- clang/lib/Format/TokenAnnotator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Format') 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)) -- cgit v1.2.3