summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-10-08 16:24:07 +0000
committerDaniel Jasper <djasper@google.com>2013-10-08 16:24:07 +0000
commitf9a5e4043cd9d04cdc45e89bfe73c4e361c5383d (patch)
tree0cbac63d0cb6cbaa1f524782555f70e852b6498f /clang/lib/Format/ContinuationIndenter.cpp
parent9ab9fe91fb6cd834597513d36936c4ad9a785a4f (diff)
downloadbcm5719-llvm-f9a5e4043cd9d04cdc45e89bfe73c4e361c5383d.tar.gz
bcm5719-llvm-f9a5e4043cd9d04cdc45e89bfe73c4e361c5383d.zip
clang-format: Improve indentation when deriving from templated classes.
Before: struct aaaaaaaaaaaaa : public aaaaaaaaaaaaaaaaaaa< // aaaaaaaaaaaaaaaa> {}; struct aaaaaaaaaaaaaaaaaaaa : public aaaaaaaaaaaaaaaaaaa< aaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaa> {}; After: struct aaaaaaaaaaaaa : public aaaaaaaaaaaaaaaaaaa< // aaaaaaaaaaaaaaaa> {}; struct aaaaaaaaaaaaaaaaaaaa : public aaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaa> {}; llvm-svn: 192187
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index ff1f1aa8534..3714088306c 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -278,9 +278,10 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
// simple assignment without binary expression on the RHS. Also indent
// relative to unary operators and the colons of constructor initializers.
State.Stack.back().LastSpace = State.Column;
- else if (Previous.Type == TT_InheritanceColon)
+ else if (Previous.Type == TT_InheritanceColon) {
State.Stack.back().Indent = State.Column;
- else if (Previous.opensScope()) {
+ State.Stack.back().LastSpace = State.Column;
+ } else if (Previous.opensScope()) {
// If a function has a trailing call, indent all parameters from the
// opening parenthesis. This avoids confusing indents like:
// OuterFunction(InnerFunctionCall( // break
OpenPOWER on IntegriCloud