clang-format: Fix bug concerning the alignment of "}".
Before:
int i; // indented 2 space more than clang-format would use.
SomeReturnType // clang-format invoked on this line.
SomeFunctionMakingLBraceEndInColumn80() {
} // This is the indent clang-format would prefer.
After:
int i; // indented 2 space more than clang-format would use.
SomeReturnType // clang-format invoked on this line.
SomeFunctionMakingLBraceEndInColumn80() {
}
llvm-svn: 186120
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 680bb13..a98d565 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -536,7 +536,7 @@
if (Current.BlockKind == BK_BracedInit)
State.Column = State.Stack[State.Stack.size() - 2].LastSpace;
else
- State.Column = Line.Level * Style.IndentWidth;
+ State.Column = FirstIndent;
} else if (Current.is(tok::string_literal) &&
State.StartOfStringLiteral != 0) {
State.Column = State.StartOfStringLiteral;