forked from OSchip/llvm-project
clang-format: Fix indentation in multi-line placement new.
Before: auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa)) typename aaaaaaaaaaaaaaaaaaaaaaaa(); After: auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa)) typename aaaaaaaaaaaaaaaaaaaaaaaa(); llvm-svn: 214964
This commit is contained in:
parent
568da0990e
commit
316ab38ed8
|
@ -561,6 +561,9 @@ unsigned ContinuationIndenter::getNewLineColumn(const LineState &State) {
|
||||||
return State.FirstIndent + Style.ConstructorInitializerIndentWidth;
|
return State.FirstIndent + Style.ConstructorInitializerIndentWidth;
|
||||||
if (NextNonComment->Type == TT_CtorInitializerComma)
|
if (NextNonComment->Type == TT_CtorInitializerComma)
|
||||||
return State.Stack.back().Indent;
|
return State.Stack.back().Indent;
|
||||||
|
if (Previous.is(tok::r_paren) && !Current.isBinaryOperator() &&
|
||||||
|
Current.isNot(tok::colon))
|
||||||
|
return ContinuationIndent;
|
||||||
if (State.Stack.back().Indent == State.FirstIndent && PreviousNonComment &&
|
if (State.Stack.back().Indent == State.FirstIndent && PreviousNonComment &&
|
||||||
PreviousNonComment->isNot(tok::r_brace))
|
PreviousNonComment->isNot(tok::r_brace))
|
||||||
// Ensure that we fall back to the continuation indent width instead of
|
// Ensure that we fall back to the continuation indent width instead of
|
||||||
|
|
|
@ -4729,6 +4729,9 @@ TEST_F(FormatTest, UnderstandsNewAndDelete) {
|
||||||
"}");
|
"}");
|
||||||
verifyFormat("new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa))\n"
|
verifyFormat("new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa))\n"
|
||||||
" typename aaaaaaaaaaaaaaaaaaaaaaaa();");
|
" typename aaaaaaaaaaaaaaaaaaaaaaaa();");
|
||||||
|
verifyFormat("auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =\n"
|
||||||
|
" new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa))\n"
|
||||||
|
" typename aaaaaaaaaaaaaaaaaaaaaaaa();");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
|
TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
|
||||||
|
|
Loading…
Reference in New Issue