From 9f82df295e59bcdef10b93e541b164ebccfe6bb2 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Tue, 28 May 2013 07:42:44 +0000 Subject: Fix formatting of expressions containing ">>". This gets turned into two ">" operators at the beginning in order to simplify template parameter handling. Thus, we need a special case to handle those two binary operators correctly. With this patch, clang-format can now correctly handle cases like: aaaaaa = aaaaaaa(aaaaaaa, // break aaaaaa) >> bbbbbb; llvm-svn: 182754 --- clang/lib/Format/Format.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Format/Format.cpp') diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index ea8a0f9f7d1..f244792e521 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -1040,6 +1040,7 @@ private: // If we need to break somewhere inside the LHS of a binary expression, we // should also break after the operator. if (Previous.Type == TT_BinaryOperator && + Current.Type != TT_BinaryOperator && // Special case for ">>". !Previous.isOneOf(tok::lessless, tok::question) && getPrecedence(Previous) != prec::Assignment && State.Stack.back().BreakBeforeParameter) -- cgit v1.2.3