diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-22 11:46:26 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-22 11:46:26 +0000 |
commit | ffee17126e10a0e2febfcfbf61d8e0d6e2fcf4c0 (patch) | |
tree | 93e1a384b188e2d3853143d1df86e8801376cf03 /unittests/Format/FormatTest.cpp | |
parent | 9ec55f24b8f848bb37a9971100cf2fca379d5572 (diff) |
Fix "*" formatting when creating arrays of pointers.
Before: A = new int * [10]();
After: A = new int *[10]();
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index ba6d7519c6..0c6385b7a1 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -1338,6 +1338,9 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) { verifyFormat("if (*b[i])"); verifyFormat("if (int *a = (&b))"); verifyFormat("while (int *a = &b)"); + + verifyFormat("A = new SomeType *[Length]();"); + verifyGoogleFormat("A = new SomeType* [Length]();"); } TEST_F(FormatTest, FormatsCasts) { |