diff options
Diffstat (limited to 'clang/lib/CodeGen/CGExprCXX.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGExprCXX.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGExprCXX.cpp b/clang/lib/CodeGen/CGExprCXX.cpp index 57d7eecc62ee..b6868c1fb1f4 100644 --- a/clang/lib/CodeGen/CGExprCXX.cpp +++ b/clang/lib/CodeGen/CGExprCXX.cpp @@ -1973,9 +1973,7 @@ static bool EmitObjectDelete(CodeGenFunction &CGF, // Find the destructor for the type, if applicable. If the // destructor is virtual, we'll just emit the vcall and return. const CXXDestructorDecl *Dtor = nullptr; - if (const RecordType *RT = ElementType->getAs<RecordType>()) { - auto *RD = - cast<CXXRecordDecl>(RT->getOriginalDecl())->getDefinitionOrSelf(); + if (const auto *RD = ElementType->getAsCXXRecordDecl()) { if (RD->hasDefinition() && !RD->hasTrivialDestructor()) { Dtor = RD->getDestructor(); |
