diff options
Diffstat (limited to 'test/SemaCXX/new-delete.cpp')
-rw-r--r-- | test/SemaCXX/new-delete.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaCXX/new-delete.cpp b/test/SemaCXX/new-delete.cpp index 13ef461e7c0d..efdfa0f066db 100644 --- a/test/SemaCXX/new-delete.cpp +++ b/test/SemaCXX/new-delete.cpp @@ -389,3 +389,11 @@ namespace PR7702 { new DoesNotExist; // expected-error {{expected a type}} } } + +namespace ArrayNewNeedsDtor { + struct A { A(); private: ~A(); }; // expected-note {{declared private here}} + struct B { B(); A a; }; // expected-error {{field of type 'ArrayNewNeedsDtor::A' has private destructor}} + B *test9() { + return new B[5]; // expected-note {{implicit default destructor for 'ArrayNewNeedsDtor::B' first required here}} + } +} |