diff options
| author | Daniel Jasper <djasper@google.com> | 2013-06-03 08:42:05 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2013-06-03 08:42:05 +0000 |
| commit | 5ef8aacd5f25767fc7bd1ec47c2b5f5fd1ac38eb (patch) | |
| tree | 5cac63a97262f12b96e38e144c54547659937129 /lib/Format/Format.cpp | |
| parent | d1b55dcf6bd61d4350b01e15590bde9bb5a334bb (diff) | |
| download | clang-5ef8aacd5f25767fc7bd1ec47c2b5f5fd1ac38eb.tar.gz clang-5ef8aacd5f25767fc7bd1ec47c2b5f5fd1ac38eb.tar.bz2 clang-5ef8aacd5f25767fc7bd1ec47c2b5f5fd1ac38eb.tar.xz | |
Fix line-breaking problem caused by comment.
Before, clang-format would not find a solution for formatting:
if ((aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ||
bbbbbbbbbbbbbbbbbb) && // aaaaaaaaaaaaaaaa
cccccc) {
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183096 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
| -rw-r--r-- | lib/Format/Format.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 3ae279216f..e0142db554 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -1040,6 +1040,7 @@ private: // should also break after the operator. if (Previous.Type == TT_BinaryOperator && Current.Type != TT_BinaryOperator && // Special case for ">>". + !Current.isTrailingComment() && !Previous.isOneOf(tok::lessless, tok::question) && Previous.getPrecedence() != prec::Assignment && State.Stack.back().BreakBeforeParameter) |
