File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -2892,7 +2892,7 @@ class CXXDestructorDecl : public CXXMethodDecl {
28922892 }
28932893
28942894 void setOperatorGlobalDelete (FunctionDecl *OD) {
2895- auto *First = cast<CXXDestructorDecl>(getFirstDecl ());
2895+ auto *First = cast<CXXDestructorDecl>(getCanonicalDecl ());
28962896 if (OD && !First->OperatorGlobalDelete )
28972897 First->OperatorGlobalDelete = OD;
28982898 }
Original file line number Diff line number Diff line change @@ -1635,7 +1635,8 @@ namespace {
16351635 // If Sema only found a global operator delete previously, the dtor can
16361636 // always call it. Otherwise we need to check the third bit and call the
16371637 // appropriate operator delete, i.e. global or class-specific.
1638- if (isa<CXXMethodDecl>(OD)) {
1638+ if (const FunctionDecl *GlobOD = Dtor->getOperatorGlobalDelete ();
1639+ isa<CXXMethodDecl>(OD) && GlobOD) {
16391640 // Third bit set signals that global operator delete is called, i.e.
16401641 // ::delete appears on the callsite.
16411642 llvm::Value *CheckTheBitForGlobDeleteCall = CGF.Builder .CreateAnd (
@@ -1649,12 +1650,7 @@ namespace {
16491650 CGF.Builder .CreateCondBr (ShouldCallGlobDelete, ClassDelete, GlobDelete);
16501651 CGF.EmitBlock (GlobDelete);
16511652
1652- const FunctionDecl *GlobOD = Dtor->getOperatorGlobalDelete ();
1653- if (GlobOD)
1654- EmitDeleteAndGoToEnd (GlobOD);
1655- else
1656- CGF.Builder .CreateUnreachable ();
1657-
1653+ EmitDeleteAndGoToEnd (GlobOD);
16581654 CGF.EmitBlock (ClassDelete);
16591655 }
16601656 EmitDeleteAndGoToEnd (OD);
You can’t perform that action at this time.
0 commit comments