diff options
| author | Daniel Jasper <djasper@google.com> | 2014-06-02 10:57:55 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2014-06-02 10:57:55 +0000 |
| commit | 278a968bf08dcc40fd5b302f73a8f1744d6c7d92 (patch) | |
| tree | 1426a63a9d6c48a134fd5c06d8d439c1d2d1545e /unittests | |
| parent | 801fc6d5442ebdbc217f574488209b0799b0e77c (diff) | |
| download | clang-278a968bf08dcc40fd5b302f73a8f1744d6c7d92.tar.gz clang-278a968bf08dcc40fd5b302f73a8f1744d6c7d92.tar.bz2 clang-278a968bf08dcc40fd5b302f73a8f1744d6c7d92.tar.xz | |
clang-format: No space between ")" and braced init list.
Before:
auto j = decltype(i) {};
After:
auto j = decltype(i){};
This fixes llvm.org/PR19892.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210013 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
| -rw-r--r-- | unittests/Format/FormatTest.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 19abd37c33..2718a8992c 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -4798,8 +4798,8 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) { verifyFormat("STATIC_ASSERT((a & b) == 0);"); verifyFormat("STATIC_ASSERT(0 == (a & b));"); verifyFormat("template <bool a, bool b> " - "typename t::if<x && y>::type f() {};"); - verifyFormat("template <int *y> f() {};"); + "typename t::if<x && y>::type f() {}"); + verifyFormat("template <int *y> f() {}"); verifyFormat("vector<int *> v;"); verifyFormat("vector<int *const> v;"); verifyFormat("vector<int *const **const *> v;"); @@ -5256,7 +5256,7 @@ TEST_F(FormatTest, LayoutCallsInsideBraceInitializers) { } TEST_F(FormatTest, LayoutBraceInitializersInReturnStatement) { - verifyFormat("return (a)(b) {1, 2, 3};"); + verifyFormat("return (a)(b){1, 2, 3};"); } TEST_F(FormatTest, LayoutCxx11BraceInitializers) { @@ -5286,6 +5286,7 @@ TEST_F(FormatTest, LayoutCxx11BraceInitializers) { verifyFormat("int foo(int i) { return fo1{}(i); }"); verifyFormat("int foo(int i) { return fo1{}(i); }"); + verifyFormat("auto i = decltype(x){};"); // In combination with BinPackParameters = false. FormatStyle NoBinPacking = getLLVMStyle(); @@ -7072,7 +7073,7 @@ TEST_F(FormatTest, DoNotCreateUnreasonableUnwrappedLines) { verifyFormat("void f() {\n" " return g() {}\n" " void h() {}"); - verifyFormat("int a[] = {void forgot_closing_brace() {f();\n" + verifyFormat("int a[] = {void forgot_closing_brace(){f();\n" "g();\n" "}"); } |
