[clang][sema] checkNoThrow - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is referenced immediately, so assert the cast is correct instead of returning nullptr
This commit is contained in:
parent
f0f4452ed4
commit
fbe0ca576d
|
@ -680,7 +680,7 @@ static void checkNoThrow(Sema &S, const Stmt *E,
|
|||
QualType::DestructionKind::DK_cxx_destructor) {
|
||||
const auto *T =
|
||||
cast<RecordType>(ReturnType.getCanonicalType().getTypePtr());
|
||||
checkDeclNoexcept(dyn_cast<CXXRecordDecl>(T->getDecl())->getDestructor(),
|
||||
checkDeclNoexcept(cast<CXXRecordDecl>(T->getDecl())->getDestructor(),
|
||||
/*IsDtor=*/true);
|
||||
}
|
||||
} else
|
||||
|
|
Loading…
Reference in a new issue