Skip to content

Commit 33ea9e2

Browse files
committed
Address review comments
1 parent bfebe21 commit 33ea9e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/Sema/CheckExprLifetime.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,11 @@ static bool isNormalAssignmentOperator(const FunctionDecl *FD) {
482482
if (RetT->isLValueReferenceType()) {
483483
ASTContext &Ctx = FD->getASTContext();
484484
QualType LHST;
485-
auto *MD = cast<CXXMethodDecl>(FD);
486-
if (MD->isCXXInstanceMember())
485+
auto *MD = dyn_cast<CXXMethodDecl>(FD);
486+
if (MD && MD->isCXXInstanceMember())
487487
LHST = Ctx.getLValueReferenceType(MD->getFunctionObjectParameterType());
488488
else
489-
LHST = MD->getParamDecl(0)->getType();
489+
LHST = FD->getParamDecl(0)->getType();
490490
if (Ctx.hasSameType(RetT, LHST))
491491
return true;
492492
}

0 commit comments

Comments
 (0)