summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-08-04 14:51:02 +0000
committerDaniel Jasper <djasper@google.com>2014-08-04 14:51:02 +0000
commit65df5aa918b4c298a2616303a085044c2cb276dd (patch)
treefe8bdaf0339eb0eefcabca092fcf508b3cba3c9b
parent7ca7df0bf961759befdc1cdde8b658bbe725245e (diff)
downloadbcm5719-llvm-65df5aa918b4c298a2616303a085044c2cb276dd.tar.gz
bcm5719-llvm-65df5aa918b4c298a2616303a085044c2cb276dd.zip
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
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp2
-rw-r--r--clang/unittests/Format/FormatTest.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 293fd3c8bd1..ed28497ab99 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -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) {
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index b175d2a2ecb..8089b3e36ec 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -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) {
OpenPOWER on IntegriCloud