Skip to content

Commit ecf14d1

Browse files
committed
Update based on review feedback; NFC
1 parent b9be245 commit ecf14d1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clang/lib/Sema/SemaExceptionSpec.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,10 +1208,8 @@ CanThrowResult Sema::canThrow(const Stmt *S) {
12081208
const FunctionDecl *OperatorDelete = DE->getOperatorDelete();
12091209
CT = canCalleeThrow(*this, DE, OperatorDelete);
12101210
if (!OperatorDelete->isDestroyingOperatorDelete()) {
1211-
if (const RecordType *RT = DTy->getAs<RecordType>()) {
1212-
const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
1213-
const CXXDestructorDecl *DD = RD->getDestructor();
1214-
if (DD)
1211+
if (const auto *RD = DTy->getAsCXXRecordDecl()) {
1212+
if (const CXXDestructorDecl *DD = RD->getDestructor())
12151213
CT = mergeCanThrow(CT, canCalleeThrow(*this, DE, DD));
12161214
}
12171215
if (CT == CT_Can)

0 commit comments

Comments
 (0)