diff options
| author | Martin Probst <martin@probst.io> | 2017-05-15 11:15:29 +0000 |
|---|---|---|
| committer | Martin Probst <martin@probst.io> | 2017-05-15 11:15:29 +0000 |
| commit | 2c1cdae2dfe5b9aa4eceb9e76fa52bf621cc66aa (patch) | |
| tree | fcb10919adfdbd37e0c505938fe5872c9d4e6818 /clang/unittests/Format/FormatTest.cpp | |
| parent | 4ab5193735ca202b7c01f3c29765dd35bc573eb1 (diff) | |
| download | bcm5719-llvm-2c1cdae2dfe5b9aa4eceb9e76fa52bf621cc66aa.tar.gz bcm5719-llvm-2c1cdae2dfe5b9aa4eceb9e76fa52bf621cc66aa.zip | |
JavaScript allows parameter lists to include trailing commas:
myFunction(param1, param2,);
For symmetry with other parenthesized lists ([...], {...}), clang-format should
wrap parenthesized lists one-per-line if they contain a trailing comma:
myFunction(
param1,
param2,
);
This is particularly useful in function declarations or calls with many
arguments, e.g. commonly in constructors.
Differential Revision: https://reviews.llvm.org/D33023
llvm-svn: 303049
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index cec25440a55..076041406c8 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -2106,7 +2106,7 @@ TEST_F(FormatTest, LayoutStatementsAroundPreprocessorDirectives) { verifyIncompleteFormat("void f(\n" "#if A\n" - " );\n" + ");\n" "#else\n" "#endif"); } @@ -4475,7 +4475,7 @@ TEST_F(FormatTest, WrapsTemplateDeclarations) { EXPECT_EQ("static_cast<A< //\n" " B> *>(\n" "\n" - " );", + ");", format("static_cast<A<//\n" " B>*>(\n" "\n" @@ -6567,7 +6567,7 @@ TEST_F(FormatTest, BreaksStringLiteralsWithin_TMacro) { "#if !TEST\n" " _T(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXn\")\n" "#endif\n" - " );", + ");", format("f(\n" "#if !TEST\n" "_T(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXn\")\n" @@ -9639,7 +9639,7 @@ TEST_F(FormatTest, FormatsLambdas) { // Other corner cases. verifyFormat("void f() {\n" " bar([]() {} // Did not respect SpacesBeforeTrailingComments\n" - " );\n" + " );\n" "}"); // Lambdas created through weird macros. |

