forked from OSchip/llvm-project
Correctly format wrapped function call parameters in templated functions.
This fixes llvm.org/PR14846. Before: template <typename T> void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( int aaaaaaaaaaaaaaaaa); After: template <typename T> void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( int aaaaaaaaaaaaaaaaa); llvm-svn: 171963
This commit is contained in:
parent
cdd5c2397a
commit
890589414b
|
@ -315,7 +315,7 @@ private:
|
|||
WhitespaceStartColumn);
|
||||
}
|
||||
|
||||
State.LastSpace[ParenLevel] = State.Indent[ParenLevel];
|
||||
State.LastSpace[ParenLevel] = State.Column;
|
||||
if (Current.is(tok::colon) && CurrentLineType != LT_ObjCMethodDecl &&
|
||||
State.NextToken->Type != TT_ConditionalExpr)
|
||||
State.Indent[ParenLevel] += 2;
|
||||
|
|
|
@ -869,6 +869,9 @@ TEST_F(FormatTest, WrapsTemplateDeclarations) {
|
|||
"aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaa,\n"
|
||||
" aaaaaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaa,\n"
|
||||
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);");
|
||||
verifyFormat("template <typename T>\n"
|
||||
"void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"
|
||||
" int aaaaaaaaaaaaaaaaa);");
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue