summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-09-06 21:46:41 +0000
committerDaniel Jasper <djasper@google.com>2013-09-06 21:46:41 +0000
commit87f18f1128ad86c6bfcf40c648419b6a02a943cb (patch)
tree55d6cc96b3cbfe6ed6a091996083f6b4dbb52a6f /clang/lib/Format
parent786a550b9fcc5fc2f0d7b0895ea0029877e9585c (diff)
downloadbcm5719-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')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp7
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;
OpenPOWER on IntegriCloud