forked from OSchip/llvm-project
clang-format: Fix bug in alignment of complex template parameters.
Before: template <typename aaaaaaaaaaa, typename bbbbbbbbbbbbb, template <typename> class cccccccccccccccccccccc, typename ddddddddddddd> class C {}; After: template <typename aaaaaaaaaaa, typename bbbbbbbbbbbbb, template <typename> class cccccccccccccccccccccc, typename ddddddddddddd> class C {}; llvm-svn: 195418
This commit is contained in:
parent
b631d5e6f3
commit
298c3403d2
|
@ -375,7 +375,8 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State,
|
|||
State.ParenLevel == 0 &&
|
||||
(!Style.IndentFunctionDeclarationAfterType ||
|
||||
State.Line->StartsDefinition))) {
|
||||
State.Column = State.Stack.back().Indent;
|
||||
State.Column =
|
||||
std::max(State.Stack.back().LastSpace, State.Stack.back().Indent);
|
||||
} else if (Current.Type == TT_ObjCSelectorName) {
|
||||
if (State.Stack.back().ColonPos == 0) {
|
||||
State.Stack.back().ColonPos =
|
||||
|
|
|
@ -3882,6 +3882,10 @@ TEST_F(FormatTest, WrapsTemplateDeclarations) {
|
|||
"template <typename T1, typename T2 = char, typename T3 = char,\n"
|
||||
" typename T4 = char>\n"
|
||||
"void f();");
|
||||
verifyFormat("template <typename aaaaaaaaaaa, typename bbbbbbbbbbbbb,\n"
|
||||
" template <typename> class cccccccccccccccccccccc,\n"
|
||||
" typename ddddddddddddd>\n"
|
||||
"class C {};");
|
||||
verifyFormat(
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa>(\n"
|
||||
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);");
|
||||
|
|
Loading…
Reference in New Issue