diff options
author | Daniel Jasper <djasper@google.com> | 2013-09-06 21:46:41 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-09-06 21:46:41 +0000 |
commit | 87f18f1128ad86c6bfcf40c648419b6a02a943cb (patch) | |
tree | 55d6cc96b3cbfe6ed6a091996083f6b4dbb52a6f /clang/lib/Format/ContinuationIndenter.cpp | |
parent | 786a550b9fcc5fc2f0d7b0895ea0029877e9585c (diff) | |
download | bcm5719-llvm-87f18f1128ad86c6bfcf40c648419b6a02a943cb.tar.gz bcm5719-llvm-87f18f1128ad86c6bfcf40c648419b6a02a943cb.zip |
clang-format: Fix regression introduced by r190038.
Before:
Constructor()
: aaaaaaaaaaaaaaaaaaaa(a), bbbbbbbbbbbbbbbbbbbbbbbb(b) {
}
After:
Constructor()
: aaaaaaaaaaaaaaaaaaaa(a), bbbbbbbbbbbbbbbbbbbbbbbb(b) {
}
llvm-svn: 190209
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 12cfd48f5b3..40d9d2f7d29 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -225,7 +225,12 @@ unsigned ContinuationIndenter::addTokenToState(LineState &State, bool Newline, Penalty += Style.PenaltyBreakFirstLessLess; if (Current.is(tok::r_brace)) { - State.Column = State.Stack[State.Stack.size() - 2].LastSpace; + if (Current.MatchingParen && + (Current.MatchingParen->BlockKind == BK_BracedInit || + !Current.MatchingParen->Children.empty())) + State.Column = State.Stack[State.Stack.size() - 2].LastSpace; + else + State.Column = State.FirstIndent; } else if (Current.is(tok::string_literal) && State.StartOfStringLiteral != 0) { State.Column = State.StartOfStringLiteral; |