summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/delete.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/delete.cpp')
-rw-r--r--test/SemaCXX/delete.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaCXX/delete.cpp b/test/SemaCXX/delete.cpp
index f94a863..0c853f6 100644
--- a/test/SemaCXX/delete.cpp
+++ b/test/SemaCXX/delete.cpp
@@ -120,6 +120,22 @@ void f() {
DELETE(d); // expected-warning {{'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'?}}
}
}
+
+namespace MissingInitializer {
+template<typename T>
+struct Base {
+ struct S {
+ const T *p1 = nullptr;
+ const T *p2 = new T[3];
+ };
+};
+
+void null_init(Base<double>::S s) {
+ delete s.p1;
+ delete s.p2;
+}
+}
+
#ifndef WITH_PCH
pch_test::X::X()
: a(new int[1]) // expected-note{{allocated with 'new[]' here}}
OpenPOWER on IntegriCloud