diff options
author | Jonas Toth <jonas.toth@gmail.com> | 2018-08-24 17:14:31 +0000 |
---|---|---|
committer | Jonas Toth <jonas.toth@gmail.com> | 2018-08-24 17:14:31 +0000 |
commit | 4636debc271f09f730697ab6873137a657c828f9 (patch) | |
tree | 9764e05099689f0f6fe6df060fe3a9eff3993369 /clang/lib/Format | |
parent | 3e1c1ce56946afb795fdaa9dbcfca2f754164166 (diff) | |
download | bcm5719-llvm-4636debc271f09f730697ab6873137a657c828f9.tar.gz bcm5719-llvm-4636debc271f09f730697ab6873137a657c828f9.zip |
[clang-format] fix PR38525 - Extraneous continuation indent spaces with BreakBeforeBinaryOperators set to All
Summary: See bug report https://bugs.llvm.org/show_bug.cgi?id=38525 for more details.
Reviewers: djasper, klimek, krasimir, sammccall
Reviewed By: sammccall
Subscribers: hiraditya, JonasToth, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D50699
llvm-svn: 340623
Diffstat (limited to 'clang/lib/Format')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 0c202565051..f035aa71e5a 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -700,7 +700,8 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, // Indent relative to the RHS of the expression unless this is a simple // assignment without binary expression on the RHS. Also indent relative to // unary operators and the colons of constructor initializers. - State.Stack.back().LastSpace = State.Column; + if (Style.BreakBeforeBinaryOperators == FormatStyle::BOS_None) + State.Stack.back().LastSpace = State.Column; } else if (Previous.is(TT_InheritanceColon)) { State.Stack.back().Indent = State.Column; State.Stack.back().LastSpace = State.Column; |