}
// 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);
}