We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfebe21 commit 33ea9e2Copy full SHA for 33ea9e2
clang/lib/Sema/CheckExprLifetime.cpp
@@ -482,11 +482,11 @@ static bool isNormalAssignmentOperator(const FunctionDecl *FD) {
482
if (RetT->isLValueReferenceType()) {
483
ASTContext &Ctx = FD->getASTContext();
484
QualType LHST;
485
- auto *MD = cast<CXXMethodDecl>(FD);
486
- if (MD->isCXXInstanceMember())
+ auto *MD = dyn_cast<CXXMethodDecl>(FD);
+ if (MD && MD->isCXXInstanceMember())
487
LHST = Ctx.getLValueReferenceType(MD->getFunctionObjectParameterType());
488
else
489
- LHST = MD->getParamDecl(0)->getType();
+ LHST = FD->getParamDecl(0)->getType();
490
if (Ctx.hasSameType(RetT, LHST))
491
return true;
492
}
0 commit comments