clang-format: Fix regression introduced by r190038.
Before:
Constructor()
: aaaaaaaaaaaaaaaaaaaa(a), bbbbbbbbbbbbbbbbbbbbbbbb(b) {
}
After:
Constructor()
: aaaaaaaaaaaaaaaaaaaa(a), bbbbbbbbbbbbbbbbbbbbbbbb(b) {
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190209 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Format/ContinuationIndenter.cpp b/lib/Format/ContinuationIndenter.cpp
index 12cfd48..40d9d2f 100644
--- a/lib/Format/ContinuationIndenter.cpp
+++ b/lib/Format/ContinuationIndenter.cpp
@@ -225,7 +225,12 @@
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;