diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-03 20:51:29 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-03 20:51:29 +0000 |
commit | 667f36accdacde57f101f8b6b61abb912f7a8e73 (patch) | |
tree | 2fcd7c2dca72b81027d59260a0ac386475d6f473 /lib/CodeGen/CGDecl.cpp | |
parent | 6ca0b32227c21ba4bc66e8f1bdbf767b563567a8 (diff) |
assert(nyi) on attempt to destruct an array of objects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 347a0af696..bda3cf7e6f 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -433,12 +433,16 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { } // Handle CXX destruction of variables. - // FIXME - destruction of arrays NYI. - if (const RecordType *RT = Ty->getAs<RecordType>()) + QualType DtorTy(Ty); + if (const ArrayType *Array = DtorTy->getAs<ArrayType>()) + DtorTy = Array->getElementType(); + if (const RecordType *RT = DtorTy->getAs<RecordType>()) if (CXXRecordDecl *ClassDecl = dyn_cast<CXXRecordDecl>(RT->getDecl())) { if (!ClassDecl->hasTrivialDestructor()) { const CXXDestructorDecl *D = ClassDecl->getDestructor(getContext()); assert(D && "EmitLocalBlockVarDecl - destructor is nul"); + assert(!Ty->getAs<ArrayType>() && "FIXME - destruction of arrays NYI"); + CleanupScope scope(*this); EmitCXXDestructorCall(D, Dtor_Complete, DeclPtr); } |