summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-04-07 08:20:35 +0000
committerDaniel Jasper <djasper@google.com>2015-04-07 08:20:35 +0000
commitacf67e3ecd26c71bd2581a5b4fca4fed50d46ab8 (patch)
treebeadbffc5eb1e3bf33a78310b1b317d7a8000784 /clang/lib/Format/ContinuationIndenter.cpp
parentdd7adf7a185d725b34721c4de446bae77a483fe2 (diff)
downloadbcm5719-llvm-acf67e3ecd26c71bd2581a5b4fca4fed50d46ab8.tar.gz
bcm5719-llvm-acf67e3ecd26c71bd2581a5b4fca4fed50d46ab8.zip
clang-format: Improve nested block formatting.
Before: functionA(functionB({ int i; int j; }), aaaa, bbbb, cccc); After: functionA(functionB({ int i; int j; }), aaaa, bbbb, cccc); llvm-svn: 234304
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index 3e4bf3e88a3..a2a68bd6d48 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -849,7 +849,8 @@ void ContinuationIndenter::moveStatePastScopeOpener(LineState &State,
bool NoLineBreak = State.Stack.back().NoLineBreak ||
(Current.is(TT_TemplateOpener) &&
State.Stack.back().ContainsUnwrappedBuilder);
- unsigned NestedBlockIndent = State.Stack.back().NestedBlockIndent;
+ unsigned NestedBlockIndent = std::max(State.Stack.back().StartOfFunctionCall,
+ State.Stack.back().NestedBlockIndent);
State.Stack.push_back(ParenState(NewIndent, NewIndentLevel,
State.Stack.back().LastSpace,
AvoidBinPacking, NoLineBreak));
OpenPOWER on IntegriCloud