clang-format: Understand parameter pack initialization.

Before:
  Constructor(A... a) : a_(X<A> { std::forward<A>(a) }...) {}

After:
  Constructor(A... a) : a_(X<A>{std::forward<A>(a)}...) {}

llvm-svn: 214720
This commit is contained in:
Daniel Jasper 2014-08-04 14:51:02 +00:00
parent 7ca7df0bf9
commit 65df5aa918
2 changed files with 2 additions and 1 deletions

View File

@ -354,7 +354,7 @@ void UnwrappedLineParser::calculateBraceTypes() {
ProbablyBracedList =
NextTok->isOneOf(tok::comma, tok::semi, tok::period, tok::colon,
tok::r_paren, tok::r_square, tok::l_brace,
tok::l_paren) ||
tok::l_paren, tok::ellipsis) ||
(NextTok->isBinaryOperator() && !NextIsObjCMethod);
}
if (ProbablyBracedList) {

View File

@ -4580,6 +4580,7 @@ TEST_F(FormatTest, UnderstandsTemplateParameters) {
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaa >> aaaaa);",
getLLVMStyleWithColumns(60));
verifyFormat("static_assert(is_convertible<A &&, B>::value, \"AAA\");");
verifyFormat("Constructor(A... a) : a_(X<A>{std::forward<A>(a)}...) {}");
}
TEST_F(FormatTest, UnderstandsBinaryOperators) {