diff options
author | dim <dim@FreeBSD.org> | 2015-12-25 14:26:58 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-12-25 14:26:58 +0000 |
commit | 1e9b8d38881c3213d1e67b0c47ab9b2c00721a5c (patch) | |
tree | 31a414b9b5f25347b7ed9a8786c34bdb277d6127 /test/SemaCXX/delete.cpp | |
parent | 4238dc458ed9a048965af111b979fd51d288f22c (diff) | |
download | FreeBSD-src-1e9b8d38881c3213d1e67b0c47ab9b2c00721a5c.zip FreeBSD-src-1e9b8d38881c3213d1e67b0c47ab9b2c00721a5c.tar.gz |
Import clang 3.7.1 release (r255217).
Diffstat (limited to 'test/SemaCXX/delete.cpp')
-rw-r--r-- | test/SemaCXX/delete.cpp | 16 |
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}} |