Fix "pointer is null" static analyzer warnings. NFCI.

Use castAs<> instead of getAs<> since the pointers are dereferenced immediately and castAs will perform the null assertion for us.
This commit is contained in:
Simon Pilgrim 2020-01-12 22:08:56 +00:00
parent ada22c804c
commit 54b2914acc
1 changed files with 2 additions and 2 deletions

View File

@ -270,8 +270,8 @@ static BaseOffset
ComputeReturnAdjustmentBaseOffset(ASTContext &Context,
const CXXMethodDecl *DerivedMD,
const CXXMethodDecl *BaseMD) {
const FunctionType *BaseFT = BaseMD->getType()->getAs<FunctionType>();
const FunctionType *DerivedFT = DerivedMD->getType()->getAs<FunctionType>();
const auto *BaseFT = BaseMD->getType()->castAs<FunctionType>();
const auto *DerivedFT = DerivedMD->getType()->castAs<FunctionType>();
// Canonicalize the return types.
CanQualType CanDerivedReturnType =