aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-11 16:09:04 +0000
committerDaniel Jasper <djasper@google.com>2013-01-11 16:09:04 +0000
commit088dab50b76d235cd5b0e701048efccfcea3677e (patch)
tree83c7ce83c92fe63b27d07d728ff5aec433e1d3c2 /unittests/Format/FormatTest.cpp
parent276a209451b8724807f2741f49c90bf27fc280c7 (diff)
Correct spacing around new and delete.
This fixes llvm.org/PR14913. Before: A *a = new(placement) A; After: A *a = new (placement) A; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172212 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 47e6bdd114..cb634fc7e1 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -980,6 +980,13 @@ TEST_F(FormatTest, UndestandsOverloadedOperators) {
verifyFormat("void operator delete[](void *ptr);");
}
+TEST_F(FormatTest, UnderstandsNewAndDelete) {
+ verifyFormat("A *a = new A;");
+ verifyFormat("A *a = new (placement) A;");
+ verifyFormat("delete a;");
+ verifyFormat("delete (A *)a;");
+}
+
TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
verifyFormat("int *f(int *a) {}");
verifyFormat("f(a, *a);");