summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/AST/DeclCXX.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp
index 942588f4ede..5f181fa67de 100644
--- a/clang/lib/AST/DeclCXX.cpp
+++ b/clang/lib/AST/DeclCXX.cpp
@@ -1413,11 +1413,15 @@ NamedDecl* getLambdaCallOperatorHelper(const CXXRecordDecl &RD) {
FunctionTemplateDecl* CXXRecordDecl::getDependentLambdaCallOperator() const {
NamedDecl *CallOp = getLambdaCallOperatorHelper(*this);
- return dyn_cast<FunctionTemplateDecl>(CallOp);
+ return dyn_cast_or_null<FunctionTemplateDecl>(CallOp);
}
CXXMethodDecl *CXXRecordDecl::getLambdaCallOperator() const {
NamedDecl *CallOp = getLambdaCallOperatorHelper(*this);
+
+ if (CallOp == nullptr)
+ return nullptr;
+
if (const auto *CallOpTmpl = dyn_cast<FunctionTemplateDecl>(CallOp))
return cast<CXXMethodDecl>(CallOpTmpl->getTemplatedDecl());
OpenPOWER on IntegriCloud