From 667f36accdacde57f101f8b6b61abb912f7a8e73 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Mon, 3 Aug 2009 20:51:29 +0000 Subject: [PATCH] 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 --- lib/CodeGen/CGDecl.cpp | 8 ++++++-- 1 file 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()) + QualType DtorTy(Ty); + if (const ArrayType *Array = DtorTy->getAs()) + DtorTy = Array->getElementType(); + if (const RecordType *RT = DtorTy->getAs()) if (CXXRecordDecl *ClassDecl = dyn_cast(RT->getDecl())) { if (!ClassDecl->hasTrivialDestructor()) { const CXXDestructorDecl *D = ClassDecl->getDestructor(getContext()); assert(D && "EmitLocalBlockVarDecl - destructor is nul"); + assert(!Ty->getAs() && "FIXME - destruction of arrays NYI"); + CleanupScope scope(*this); EmitCXXDestructorCall(D, Dtor_Complete, DeclPtr); } -- 2.40.0