diff options
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Format/Format.cpp | 4 | ||||
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 7d4048f1049..d408b3862b1 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -520,7 +520,7 @@ private: LBrace.Children.size() == 0) // The previous token does not open a block. Nothing to do. We don't // assert so that we can simply call this function for all tokens. - return true; + return true; if (NewLine) { unsigned ParentIndent = State.Stack.back().Indent; @@ -624,7 +624,7 @@ private: ++FormatTok->NewlinesBefore; // FIXME: This is technically incorrect, as it could also // be a literal backslash at the end of the line. - if (i == 0 || FormatTok->TokenText[i-1] != '\\') + if (i == 0 || FormatTok->TokenText[i - 1] != '\\') FormatTok->HasUnescapedNewline = true; FormatTok->LastNewlineOffset = WhitespaceLength + i + 1; Column = 0; diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index c725f5097e2..e3cd2105e63 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1137,7 +1137,8 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line, return 2; if (Right.isMemberAccess()) { - if (Left.isOneOf(tok::r_paren, tok::r_square)) + if (Left.isOneOf(tok::r_paren, tok::r_square) && Left.MatchingParen && + Left.MatchingParen->ParameterCount > 0) return 20; // Should be smaller than breaking at a nested comma. return 150; } |

