aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
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);");