Skip to content

Commit

Permalink
[clang] Relax assertion on generating destructor call
Browse files Browse the repository at this point in the history
If the Decl pointers are not identical, declaresSameEntity will check
the canonical Decls. This fixes the df021_createTGraph tutorial on
CentOS 8.

Upstream discussion in https://reviews.llvm.org/D137787
  • Loading branch information
hahnjo committed Nov 23, 2022
1 parent 5a11c16 commit c3a88ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions interpreter/llvm/src/tools/clang/lib/CodeGen/CGExprCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ RValue CodeGenFunction::EmitCXXDestructorCall(
const CXXMethodDecl *DtorDecl = cast<CXXMethodDecl>(Dtor.getDecl());

assert(!ThisTy.isNull());
assert(ThisTy->getAsCXXRecordDecl() == DtorDecl->getParent() &&
"Pointer/Object mixup");
assert(
declaresSameEntity(ThisTy->getAsCXXRecordDecl(), DtorDecl->getParent()) &&
"Pointer/Object mixup");

LangAS SrcAS = ThisTy.getAddressSpace();
LangAS DstAS = DtorDecl->getMethodQualifiers().getAddressSpace();
Expand Down

0 comments on commit c3a88ba

Please sign in to comment.