diff options
| author | Daniel Jasper <djasper@google.com> | 2013-05-14 20:39:56 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2013-05-14 20:39:56 +0000 |
| commit | 571f1af0bb658b36ec068ca9ec2c627568a4ce30 (patch) | |
| tree | a501a94b53748d8066e23d10bbe7f26cabeaa7dd /clang/lib/Format | |
| parent | 91a1b2c9ebfc8a707a2ef8f9b6d31ed3c478958a (diff) | |
| download | bcm5719-llvm-571f1af0bb658b36ec068ca9ec2c627568a4ce30.tar.gz bcm5719-llvm-571f1af0bb658b36ec068ca9ec2c627568a4ce30.zip | |
Fix expression breaking for one-parameter-per-line styles.
Before:
if (aaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaa ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaa ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaa ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}
After:
if (aaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaa ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaa ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}
llvm-svn: 181828
Diffstat (limited to 'clang/lib/Format')
| -rw-r--r-- | clang/lib/Format/Format.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 5cb5fef9d54..e85ecd21c2e 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -543,7 +543,8 @@ private: if (State.Stack.back().AvoidBinPacking) { // If we are breaking after '(', '{', '<', this is not bin packing // unless AllowAllParametersOfDeclarationOnNextLine is false. - if ((Previous.isNot(tok::l_paren) && Previous.isNot(tok::l_brace)) || + if (!(Previous.isOneOf(tok::l_paren, tok::l_brace) || + Previous.Type == TT_BinaryOperator) || (!Style.AllowAllParametersOfDeclarationOnNextLine && Line.MustBeDeclaration)) State.Stack.back().BreakBeforeParameter = true; |

