Skip to content

Commit 1de3f1f

Browse files
committed
Address review feedback
* Fixes a typo in the release notes * Minor optimization
1 parent 10985bc commit 1de3f1f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ Bug Fixes in This Version
656656
``_Atomic``-qualified type (#GH116124).
657657
- No longer return ``false`` for ``noexcept`` expressions involving a
658658
``delete`` which resolves to a destroying delete but the type of the object
659-
being deleted as a potentially throwing destructor (#GH118660).
659+
being deleted has a potentially throwing destructor (#GH118660).
660660

661661
Bug Fixes to Compiler Builtins
662662
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/lib/Sema/SemaExceptionSpec.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,15 +1206,16 @@ CanThrowResult Sema::canThrow(const Stmt *S) {
12061206
CT = CT_Dependent;
12071207
} else {
12081208
const FunctionDecl *OperatorDelete = DE->getOperatorDelete();
1209-
CT = canCalleeThrow(*this, DE, OperatorDelete);
1210-
if (const RecordType *RT = DTy->getAs<RecordType>()) {
1211-
const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
1212-
const CXXDestructorDecl *DD = RD->getDestructor();
1213-
if (DD && !OperatorDelete->isDestroyingOperatorDelete())
1209+
if (!OperatorDelete->isDestroyingOperatorDelete()) {
1210+
CT = canCalleeThrow(*this, DE, OperatorDelete);
1211+
if (const RecordType *RT = DTy->getAs<RecordType>()) {
1212+
const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
1213+
const CXXDestructorDecl *DD = RD->getDestructor();
12141214
CT = mergeCanThrow(CT, canCalleeThrow(*this, DE, DD));
1215+
}
1216+
if (CT == CT_Can)
1217+
return CT;
12151218
}
1216-
if (CT == CT_Can)
1217-
return CT;
12181219
}
12191220
return mergeCanThrow(CT, canSubStmtsThrow(*this, DE));
12201221
}

0 commit comments

Comments
 (0)