summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 56aa384e744..afa9840619e 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1801,12 +1801,13 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line,
return true;
if (Left.Type == TT_ArrayInitializerLSquare)
return true;
- return (Left.isBinaryOperator() && Left.isNot(tok::lessless) &&
+ return (Left.isBinaryOperator() &&
+ !Left.isOneOf(tok::arrowstar, tok::lessless) &&
!Style.BreakBeforeBinaryOperators) ||
Left.isOneOf(tok::comma, tok::coloncolon, tok::semi, tok::l_brace,
tok::kw_class, tok::kw_struct) ||
- Right.isOneOf(tok::lessless, tok::arrow, tok::period, tok::colon,
- tok::l_square, tok::at) ||
+ Right.isMemberAccess() ||
+ Right.isOneOf(tok::lessless, tok::colon, tok::l_square, tok::at) ||
(Left.is(tok::r_paren) &&
Right.isOneOf(tok::identifier, tok::kw_const)) ||
(Left.is(tok::l_paren) && !Right.is(tok::r_paren));
OpenPOWER on IntegriCloud