Improve clang-format's understanding of casts.
This fixes llvm.org/PR14684.
Before: int *pa = (int *) & a;
After: int *pa = (int *)&a;
We still don't understand all kinds of casts. I added a FIXME to
address that.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172056 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 739bcdd..51a0bd6 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -980,6 +980,7 @@
verifyFormat("a * -b;");
verifyFormat("a * ++b;");
verifyFormat("a * --b;");
+ verifyFormat("int *pa = (int *)&a;");
verifyFormat("InvalidRegions[*R] = 0;");
@@ -988,8 +989,8 @@
verifyFormat("A<int *, int *> a;");
verifyFormat("A<int **, int **> a;");
verifyFormat("Type *A = static_cast<Type *>(P);");
- verifyFormat("Type *A = (Type *) P;");
- verifyFormat("Type *A = (vector<Type *, int *>) P;");
+ verifyFormat("Type *A = (Type *)P;");
+ verifyFormat("Type *A = (vector<Type *, int *>)P;");
verifyFormat(
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"