[clang] [CIR] Implement Statement Expressions (PR #153677)
Morris Hafner via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 18 07:30:46 PDT 2025
================
@@ -1178,11 +1178,11 @@ static void pushTemporaryCleanup(CIRGenFunction &cgf,
->getBaseElementTypeUnsafe()
->getAs<clang::RecordType>()) {
// Get the destructor for the reference temporary.
- auto *classDecl =
- cast<CXXRecordDecl>(rt->getOriginalDecl()->getDefinitionOrSelf());
- if (!classDecl->hasTrivialDestructor())
- referenceTemporaryDtor =
- classDecl->getDefinitionOrSelf()->getDestructor();
+ if (const auto *classDecl = dyn_cast<CXXRecordDecl>(
+ rt->getOriginalDecl()->getDefinitionOrSelf())) {
+ if (!classDecl->hasTrivialDestructor())
+ referenceTemporaryDtor = classDecl->getDestructor();
----------------
mmha wrote:
Good question. From what I can tell this was introduced in https://github.com/llvm/clangir/pull/872 and it looks like this slipped through. `ReferenceTemporaryDtor ` should be declared within that switch. I'll make that fix.
https://github.com/llvm/llvm-project/pull/153677
More information about the cfe-commits
mailing list